Skip to content

Commit e003f65

Browse files
mkreymanclaude
andcommitted
feat: Add comprehensive pre-commit hooks for quality assurance
Implemented robust pre-commit hooks to prevent quality issues: Quality Checks (All must pass before commit): ✅ Build compilation (npm run build) ✅ TypeScript type checking (npm run type-check) ✅ ESLint code linting (npm run lint) ✅ Prettier code formatting (lint-staged) ✅ Complete test suite (npm test - all 1087 tests) Tools Added: - Husky for git hook management - lint-staged for staged file processing - Comprehensive pre-commit hook script Benefits: - Prevents failing tests from reaching repository - Ensures consistent code formatting and style - Catches TypeScript errors before commits - Maintains build integrity across all commits - Forces quality standards for entire team This addresses the QA failure that allowed a failing test to be committed and pushed, ensuring it never happens again. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent ee0e9a1 commit e003f65

File tree

4 files changed

+675
-4
lines changed

4 files changed

+675
-4
lines changed

.husky/pre-commit

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
echo "🔍 Running pre-commit quality checks..."
5+
6+
# Run lint-staged for staged files
7+
npx lint-staged
8+
9+
# Run build to ensure compilation succeeds
10+
echo "🏗️ Building project..."
11+
npm run build
12+
13+
# Run type checking
14+
echo "🔍 Type checking..."
15+
npm run type-check
16+
17+
# Run tests to ensure nothing is broken
18+
echo "🧪 Running tests..."
19+
npm test
20+
21+
echo "✅ All quality checks passed!"

.lintstagedrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"*.{ts,js}": ["eslint --fix", "prettier --write"],
3+
"*.{md,json}": ["prettier --write"]
4+
}

0 commit comments

Comments
 (0)