https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 1d24d696ccd70b20e707f55d9921def6d8a7ae7a authored by gildas on 23 February 2017, 10:56:02 UTC
4.4.3
Tip revision: 1d24d69
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