https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 20d848996aba5d5c05e7f62cd4ab551002994efa authored by Kmaschta on 21 November 2018, 16:33:10 UTC
v9.3.3
Tip revision: 20d8489
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