https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 75719006295245912046bf20898ffbf668962363 authored by ThieryMichel on 26 September 2018, 14:10:59 UTC
Merge pull request #701 from Inist-CNRS/fix-dockerfile
Tip revision: 7571900
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