https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: fab03f54646dc0367a2dc0a9c13d9564f8721bde authored by Nicolas Thouvenin on 07 May 2018, 07:14:40 UTC
8.19.0
Tip revision: fab03f5
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