diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..ea5a55b --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +bunx lint-staged diff --git a/README.md b/README.md index 0f8c98d..65aca36 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,6 @@ npm run dev npm run deploy ``` -pre-commit hook for Sapling (`.sl/config`): - -``` -[hooks] -precommit = echo $HG_PARENT1 && bun prettier $(sl show -T "{file_adds} {file_mods}\n\n" $HG_PARENT1 --stat | head -n 1) --write --no-error-on-unmatched-pattern -``` - ## Development If a route is internal-only or doesn't need to appear on the OpenAPI spec (that's autogenerated by Hono), use the `Hono` class. Otherwise, use the `OpenAPIHono` class from `@hono/zod-openapi`. diff --git a/bun.lockb b/bun.lockb index fea498c..d194c7b 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 18477be..b96b679 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "env:verify": "bun src/scripts/verifyEnv.ts", "db:generate": "drizzle-kit generate", "db:migrate": "drizzle-kit migrate", - "test": "bun src/testRunner.ts" + "test": "bun src/testRunner.ts", + "prepare": "husky" }, "dependencies": { "@consumet/extensions": "github:consumet/consumet.ts#2bcd9287dc1471ed081bc23333e7629779924e0e", @@ -33,6 +34,8 @@ "@types/bun": "^1.1.2", "@types/yargs": "^17.0.32", "drizzle-kit": "^0.22.6", + "husky": "^9.0.11", + "lint-staged": "^15.2.7", "msw": "^2.3.0", "prettier": "^3.2.5", "prettier-plugin-toml": "^2.0.1", @@ -41,5 +44,8 @@ "wrangler": "^3.47.0", "yargs": "^17.7.2", "zx": "^8.1.2" + }, + "lint-staged": { + "**/*": "prettier --write --ignore-unknown" } }