Skip to content

Commit 41b544c

Browse files
committed
chore: add pre-commit hook for formatting and type checking
Husky + lint-staged runs oxfmt on staged files and tsc --noEmit on every commit, catching formatting drift and type errors before they reach CI.
1 parent 5e7d2a5 commit 41b544c

3 files changed

Lines changed: 70 additions & 1 deletion

File tree

.husky/pre-commit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env sh
2+
npx --no -- lint-staged
3+
bunx tsc --noEmit

bun.lock

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@
4949
"test": "bun test",
5050
"start": "bun src/cli.ts",
5151
"build": "bun build --compile --outfile dist/beflow ./src/cli.ts",
52-
"gen:schema": "bun scripts/gen-config-schema.ts"
52+
"gen:schema": "bun scripts/gen-config-schema.ts",
53+
"prepare": "husky"
54+
},
55+
"lint-staged": {
56+
"*.{ts,tsx,js,jsx,jsonc}": "oxfmt"
5357
},
5458
"dependencies": {
5559
"@clack/prompts": "^1.5.1",
@@ -60,6 +64,8 @@
6064
},
6165
"devDependencies": {
6266
"bun-types": "^1.1.0",
67+
"husky": "^9.1.7",
68+
"lint-staged": "^17.0.8",
6369
"oxfmt": "^0.54.0",
6470
"oxlint": "^1.69.0",
6571
"oxlint-tsgolint": "^0.23.0",

0 commit comments

Comments
 (0)