https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 07fbb5554af176763d95e0f4f3802b7ff657ff2e authored by Anthony Rimet on 24 March 2023, 07:07:12 UTC
12.54.3
Tip revision: 07fbb55
pre-commit
#!/bin/sh
# Ensure all javascript files staged for commit pass standard code style
ROOT_DIR=$(git rev-parse --show-toplevel)
LINT="${ROOT_DIR}/node_modules/eslint/bin/eslint.js --ext .js --ext .jsx"

git diff --name-only --cached --relative | grep '\.jsx\?$' | xargs node $LINT
if [ $? -ne 0 ]; then exit 1; fi
back to top