https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 3abae1199892340ba03c2ad6e9795fc840bed12e authored by Corentin Sardo on 28 August 2019, 13:28:08 UTC
10.0.0
Tip revision: 3abae11
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