https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: a473a4941ce5f3a6fb2416eaf3480a38c9d68ecf authored by ThieryMichel on 22 January 2018, 11:03:13 UTC
8.12.3
Tip revision: a473a49
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