feat(deps): pre-commit type-check on staged TS files
Pre-commit now runs `tsc` against the staged ts/tsx files (and their dep graph) in ~3s, catching type errors before they hit CI. Used to skip type-check entirely on pre-commit because full-project tsc is ~22s — too slow for the commit hook. Drops a 30-LOC shim in `scripts/tsc-staged.mjs` instead of the `tsc-files` package: that lib's binary-resolution path (`typescript/../.bin/tsc`) doesn't exist under pnpm's virtual-store layout, so spawnSync returns `status: null` and the check silently no-ops. Filed upstream-style: the package hasn't shipped in 3 years. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"*.{ts,tsx}": ["eslint --fix", "prettier --write"],
|
||||
"*.{ts,tsx}": ["eslint --fix", "prettier --write", "node scripts/tsc-staged.mjs"],
|
||||
"*.{json,md,css}": ["prettier --write"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user