Pre-Commit Checklist
Run these checks before committing code to ensure quality.
Quick Commands
npm run check # TypeScript type checking
npm run lint # Prettier + ESLint check
npm run test # Run all tests
npm run format # Auto-fix formatting issues
Full Pre-Commit Flow
Format code (auto-fix):
npm run format
Check types:
npm run check
Run linter:
npm run lint
Run tests:
npm run test
Stage and commit (if all pass):
git add <files>
git commit -m "message"
One-Liner
Run all checks in sequence (stops on first failure):
npm run format && npm run check && npm run lint && npm run test
Common Issues
| Issue |
Fix |
| Prettier errors |
Run npm run format |
| ESLint errors |
Fix manually or check .eslintrc |
| Type errors |
Fix TypeScript issues in code |
| Test failures |
Fix failing tests before commit |
Notes
- Always run checks before pushing to remote
- Format first to avoid unnecessary lint errors
- Tests should pass in CI - don't skip locally