Skip to content

Commit 6eacc6d

Browse files
feat: add husky and lint-staged to apply prettier formatting and eslint as pre commit hooks (#245)
1 parent d4fa7a1 commit 6eacc6d

3 files changed

Lines changed: 727 additions & 457 deletions

File tree

clients/web/.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+
cd clients/web
3+
pnpm dlx lint-staged

clients/web/package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414
"format": "prettier --write --cache .",
1515
"lint": "eslint . --ext .ts,.tsx",
1616
"lint:fix": "eslint . --fix --ext .ts,.tsx",
17-
"test": "cross-env TZ=UTC pnpm proto && vitest"
17+
"test": "cross-env TZ=UTC pnpm proto && vitest",
18+
"prepare": "cd ../.. && husky clients/web/.husky"
19+
},
20+
"lint-staged": {
21+
"*": "pnpm format",
22+
"*.{ts,tsx}": "pnpm lint"
1823
},
1924
"devDependencies": {
2025
"@protobuf-ts/protoc": "^2.9.3",
@@ -32,7 +37,9 @@
3237
"eslint": "^8.56.0",
3338
"eslint-config-prettier": "^9.0.0",
3439
"eslint-plugin-solid": "^0.13.0",
40+
"husky": "^9.0.11",
3541
"jsdom": "^24.0.0",
42+
"lint-staged": "^15.2.2",
3643
"postcss": "^8.4.35",
3744
"prettier": "^3.2.5",
3845
"tailwindcss": "^3.4.1",

0 commit comments

Comments
 (0)