Files
nowdatabase/.husky/pre-commit
T
karilint 8c1f809a19 Optimize linting performance for faster development workflow
Performance Improvements:
- Add ESLint --cache flags to all lint commands (frontend, backend, cypress)
- Frontend linting: 80s -> 2.5s on subsequent runs (97% improvement)
- Backend and Cypress linting also benefit from caching

Configuration Changes:
- Update frontend/package.json: Add --cache flag to lint script
- Update backend/package.json: Add --cache flag to lint script
- Update package.json: Add --cache flag to lint:cypress script
- Add lint:staged script preparation (npx lint-staged)
- Update pre-commit hook to use optimized lint:staged approach
- Add lint-staged configuration for changed-files-only linting

Resolves: Slow pre-commit hooks that caused development delays
Impact: Dramatic reduction in linting time, especially on repeated runs
2026-03-30 18:11:33 +03:00

15 lines
343 B
Bash
Executable File

#!/usr/bin/env sh
if [ "$HUSKY_SKIP_CHECKS" = "1" ]; then
echo "Husky pre-commit checks skipped via HUSKY_SKIP_CHECKS."
exit 0
fi
command -v npm >/dev/null 2>&1 || {
echo "npm not found. Install dependencies before committing." >&2
exit 1
}
# Use lint-staged for faster pre-commit checks (only on changed files)
npm run lint:staged