with one click
pre-commit-checks
// Run and troubleshoot the pre-commit hook quality checks. Use when commits fail, when adding new checks, or when verifying code quality locally.
// Run and troubleshoot the pre-commit hook quality checks. Use when commits fail, when adding new checks, or when verifying code quality locally.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | pre-commit-checks |
| description | Run and troubleshoot the pre-commit hook quality checks. Use when commits fail, when adding new checks, or when verifying code quality locally. |
| metadata | {"version":"2.0"} |
The pre-commit hook uses lint-staged for performance, running checks only on staged files. All must pass for a commit to proceed.
./node_modules/.bin/lint-staged
Configuration in package.json under "lint-staged":
prettier --write → eslint --fixprettier --writeRuns only on staged files for maximum performance.
npx tsc --noEmit
Runs on the full project (fast enough, ensures project-wide type safety). No auto-fix — type errors must be resolved manually.
./node_modules/.bin/vitest related --run $(git diff --name-only --cached)
Runs tests only for files related to staged changes using Vitest's "related" mode.
If pre-commit passes locally, CI must be green. If this guarantee is ever broken, it is a bug in the pipeline and must be fixed immediately.
./node_modules/.bin/) instead of npx to avoid $PATH issues// @ts-ignore or any to suppress.npx vitest interactively to debug. The hook only tests files related to your changes..husky/pre-commit is executable: chmod +x .husky/pre-commitnpm install to install dependencies.To run checks manually before committing:
# Format all files
npm run format
# Lint all files
npm run lint
# Type check
npm run typecheck
# Run full test suite
npm test