https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 96fbd4c9f69331501eb9eba109b9d1a87f6ee6ca authored by Nicolas Thouvenin on 05 February 2018, 16:20:46 UTC
8.16.1
Tip revision: 96fbd4c
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