From 3d6e683f5e3cf397388e9b440721935709e20675 Mon Sep 17 00:00:00 2001 From: Will Chen Date: Thu, 28 Aug 2025 21:19:03 -0700 Subject: [PATCH] pre commit (#1119) ## Summary by cubic Adds an explicit Husky pre-commit setup to run the formatter and linter before each commit. Replaces the auto-run prepare hook with a manual npm run init-precommit command. - **Migration** - Run npm run init-precommit once in your repo to install the pre-commit hook. --- CONTRIBUTING.md | 10 ++++++++++ package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7341039..ee3a547 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,6 +33,16 @@ npm run db:push npm start ``` +## Setup + +If you'd like to contribute a pull request, we highly recommend setting the pre-commit hooks which will run the formatter and linter before each git commit. This is a great way of catching issues early on without waiting to run the GitHub Actions for your pull requet. + +Simply run this once in your repo: + +```sh +npm run init-precommit +``` + ## Testing ### Unit tests diff --git a/package.json b/package.json index f63e6f9..de3c916 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "test:watch": "vitest", "test:ui": "vitest --ui", "extract-codebase": "ts-node scripts/extract-codebase.ts", - "prepare": "husky install", + "init-precommit": "husky", "pre:e2e": "cross-env E2E_TEST_BUILD=true npm run package", "e2e": "playwright test", "e2e:shard": "playwright test --shard"