https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: d1a9d21081391697ede19164f7e39cad32acbe64 authored by ThieryMichel on 14 December 2017, 13:44:55 UTC
8.5.0
Tip revision: d1a9d21
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