Back to listShell
Git Pre-commit Hook
Lv.3180@mukitaro0 playsJan 2, 2026
Git pre-commit hook for linting staged JavaScript files. Common in Husky setups.
preview.shell
1STAGED=$(git diff --cached --name-only --diff-filter=ACM)2for file in $STAGED; do3 if [[ $file == *.js ]]; then4 npx eslint "$file" || exit 15 fi6done7echo "All checks passed"Custom problems are not included in rankings