https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 4ac5134b8776ead386ee56bedb9da20f89152b54 authored by ThieryMichel on 27 April 2017, 09:16:37 UTC
7.10.0
Tip revision: 4ac5134
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