Revision bd972e87d562c0880a5d3a15c4b3974327311c42 authored by ThieryMichel on 02 March 2017, 10:01:31 UTC, committed by ThieryMichel on 02 March 2017, 10:01:31 UTC
1 parent a5268e6
Raw File
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