Skip to content

Commit 2859297

Browse files
authored
feat: add husky pre-commit hooks for code quality (#25)
1 parent e50bcdf commit 2859297

File tree

4 files changed

+302
-1
lines changed

4 files changed

+302
-1
lines changed

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm lint-staged

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"lint": "biome check --write --unsafe",
2424
"format": "biome format --write",
2525
"check:write": "pnpm run lint && pnpm run typecheck",
26-
"generate-client": "tsx scripts/update-openapi-client.ts"
26+
"generate-client": "tsx scripts/update-openapi-client.ts",
27+
"prepare": "husky"
2728
},
2829
"keywords": [
2930
"posthog",
@@ -48,6 +49,8 @@
4849
"eslint": "^8.56.0",
4950
"eslint-plugin-react": "^7.33.2",
5051
"eslint-plugin-react-hooks": "^4.6.0",
52+
"husky": "^9.1.7",
53+
"lint-staged": "^15.5.2",
5154
"mprocs": "^0.7.3",
5255
"postcss": "^8.4.33",
5356
"tailwindcss": "^3.4.1",
@@ -77,6 +80,12 @@
7780
"uuid": "^9.0.1",
7881
"zustand": "^4.5.0"
7982
},
83+
"lint-staged": {
84+
"*.{ts,tsx,js,jsx}": [
85+
"biome check --write --unsafe --files-ignore-unknown=true --no-errors-on-unmatched",
86+
"bash -c 'pnpm typecheck'"
87+
]
88+
},
8089
"build": {
8190
"appId": "com.posthog.array",
8291
"productName": "Array",

0 commit comments

Comments
 (0)