Skip to content

Commit 3298b31

Browse files
committed
revert: restore husky pre-commit hook removed in #980
This restores the husky pre-commit hook configuration that was removed in PR #980. The hook runs lint-staged on staged .ts and .tsx files.
1 parent 2b16114 commit 3298b31

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
pnpm lint-staged

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"format": "prettier --experimental-cli --ignore-unknown '**/*' --write",
1717
"lint": "pnpm --filter \"./packages/**\" lint",
1818
"lint-all": "eslint . --fix",
19+
"prepare": "husky",
1920
"test": "pnpm --filter \"./packages/**\" test",
2021
"test:docs": "node scripts/verify-links.ts",
2122
"generate-docs": "node scripts/generate-docs.ts"
@@ -38,8 +39,10 @@
3839
"eslint": "^9.39.1",
3940
"eslint-import-resolver-typescript": "^4.4.4",
4041
"eslint-plugin-react": "^7.37.5",
42+
"husky": "^9.1.7",
4143
"jsdom": "^27.2.0",
4244
"knip": "^5.70.2",
45+
"lint-staged": "^15.5.2",
4346
"markdown-link-extractor": "^4.0.3",
4447
"prettier": "^3.7.3",
4548
"publint": "^0.3.15",
@@ -51,5 +54,10 @@
5154
"vite": "^7.2.6",
5255
"vitest": "^3.2.4",
5356
"zod": "^3.25.76"
57+
},
58+
"lint-staged": {
59+
"*.{ts,tsx}": [
60+
"eslint --fix"
61+
]
5462
}
5563
}

0 commit comments

Comments
 (0)