https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: ed71779d6370b9b5f2440cca655e4fe1fe247437 authored by ThieryMichel on 06 March 2017, 12:33:20 UTC
5.1.0
Tip revision: ed71779
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