https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: d39188d46fa2f50ce54b242caef6776cfa36ca74 authored by ThieryMichel on 20 December 2017, 13:10:54 UTC
8.7.1
Tip revision: d39188d
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