chore(husky): add pre-commit hook running tsc + eslint

Adds husky as a dev dep and wires .husky/pre-commit to run:
  npx tsc --noEmit
  npx eslint src/

Both must pass for the commit to land. Smoke is intentionally NOT in
the hook because it needs a live dev server — run `npm run smoke`
manually before opening a PR.

Catches the regressions a 100-commit refactor sweep can introduce
(broken zod schema, missed import, accidentally-disabled rule)
before they reach origin/main, complementing the human / cron /
agent commit flow we've established.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
g-butandClaude Opus 4.7 committed 2026-04-26 11:35:54 +02:00
1 parent 3b11b5ec92
commit bceacc8222
4 files changed
+35 -1

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/env sh
# Run quick correctness checks on every commit. Smoke (which needs a
# running dev server) is intentionally NOT here — run `npm run smoke`
# manually before opening a PR.
set -e
echo "→ tsc --noEmit"
npx tsc --noEmit
echo "→ eslint src/"
npx eslint src/
+3
View File
@@ -86,6 +86,9 @@ npx drizzle-kit push # Push schema changes to Postgres
npx tsx scripts/seed.ts # Re-seed database from knowledge.sqlite + contacts
```
A husky pre-commit hook runs `tsc --noEmit` and `eslint src/` automatically.
Smoke is opt-in (needs the dev server running) — run before opening a PR.
## Views
| View | Route | Status |
+17
View File
@@ -33,6 +33,7 @@
"drizzle-kit": "^0.31.10",
"eslint": "^9",
"eslint-config-next": "16.2.2",
"husky": "^9.1.7",
"tailwindcss": "^4",
"tsx": "^4.21.0",
"typescript": "^5"
@@ -6945,6 +6946,22 @@
"node": ">=18.18.0"
}
},
"node_modules/husky": {
"version": "9.1.7",
"resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz",
"integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==",
"dev": true,
"license": "MIT",
"bin": {
"husky": "bin.js"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/typicode"
}
},
"node_modules/iconv-lite": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz",
+3 -1
View File
@@ -7,7 +7,8 @@
"build": "next build",
"start": "next start",
"lint": "eslint",
"smoke": "bash scripts/smoke.sh"
"smoke": "bash scripts/smoke.sh",
"prepare": "husky"
},
"dependencies": {
"@base-ui/react": "^1.3.0",
@@ -35,6 +36,7 @@
"drizzle-kit": "^0.31.10",
"eslint": "^9",
"eslint-config-next": "16.2.2",
"husky": "^9.1.7",
"tailwindcss": "^4",
"tsx": "^4.21.0",
"typescript": "^5"