https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: a55b2c15c6b19c3fa2b761e0abd17e135be4ae56 authored by gildas on 04 April 2017, 13:02:33 UTC
7.2.1
Tip revision: a55b2c1
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