# Lefthook Configuration
# Git hooks automation for code quality checks
# Documentation: https://lefthook.dev/configuration/
rc: ~/.lefthookrc
# Pre-commit: Fast checks before committing
pre-commit:
parallel: true
commands:
# BiomeJS formatting (auto-fix)
format:
glob: "*.{ts,js,json,md}"
run: npm run format:fix
stage_fixed: true
# BiomeJS linting and formatting (auto-fix)
check:
glob: "*.{ts,js}"
run: npm run check:fix
stage_fixed: true
# Lockfile integrity check
lockfile-check:
glob: "package-lock.json"
run: |
if grep -q '"lockfileVersion": 3' package-lock.json; then
echo "✅ Lockfile version 3 verified"
else
echo "❌ Error: package-lock.json must use lockfileVersion 3"
echo "Please regenerate with: npm install"
exit 1
fi
# Pre-push: Comprehensive checks before pushing
pre-push:
parallel: true
commands:
# TypeScript type checking
typecheck:
run: npm run typecheck
# Unit tests (fast)
test-unit:
run: npm run test:unit
# Integration tests
test-integration:
run: npm run test:integration
# Build verification
build:
run: npm run build