https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: b952826e56c35808435ad441939c6d3fb85d719a authored by Matthieu Chaffotte on 03 January 2020, 13:50:03 UTC
Merge pull request #1050 from Inist-CNRS/releases/v11.8.0
Tip revision: b952826
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