https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: c5d02e32fa1ebe0109db4e19a32b81b88141074d authored by Julien Demangeon on 23 February 2021, 16:17:20 UTC
Merge pull request #1219 from Inist-CNRS/version12.0.16
Tip revision: c5d02e3
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