https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 9801812f692c1387102065079f4a602dad2c3c90 authored by ThieryMichel on 18 January 2018, 10:44:45 UTC
8.12.2
Tip revision: 9801812
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