https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 937351454a5a4d3cf447716abacf33433d9f8061 authored by Nicolas Thouvenin on 13 November 2017, 14:40:10 UTC
7.24.0
Tip revision: 9373514
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