https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: a2ebdce5d2e6aff495dc439b149ca33c5a31869f authored by Matthieu Chaffotte on 10 December 2019, 15:52:27 UTC
Merge pull request #1028 from Inist-CNRS/releases/v11.7.0
Tip revision: a2ebdce
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