https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: d151e0c014d5ba27dd621dd3697a2a0220dd0acd authored by Nicolas Thouvenin on 03 January 2019, 11:05:07 UTC
9.4.0
Tip revision: d151e0c
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