This repository ships a Git pre-commit hook suite that blocks commits when staged frontend source changes fail quality gates.
Run the setup command once after cloning the repository:
pnpm run prepareThe command points Git at the versioned .githooks/ directory via core.hooksPath.
The hook inspects staged files and runs only the checks relevant to those file types. ESLint receives the staged source file list directly so unrelated existing lint debt does not block focused commits:
| Check | Command | Runs when staged files include |
|---|---|---|
| ESLint | pnpm exec eslint --max-warnings=0 <staged files> |
JavaScript or TypeScript files |
| TypeScript | pnpm exec tsc --noEmit |
TypeScript files |
| Unit suite | pnpm run test:all |
TypeScript files |
These checks are intentionally dependency-free beyond the existing project toolchain, keeping the hook portable across developer machines and CI workspaces.
Avoid bypassing hooks. If an emergency fix requires it, use Git's explicit bypass flag and document the follow-up remediation in the pull request:
git commit --no-verify- If a check fails, run the printed command directly for full output.
- Fix the reported lint, type, or test failure.
- Stage the fix and commit again.
- If the hook itself appears broken, verify
git config core.hooksPathreturns.githooksafter runningpnpm run prepare.