Revision e7fc81f393c1d84e26217276fbf6606bce324955 authored by François Parmentier on 09 May 2017, 15:58:44 UTC, committed by François Parmentier on 09 May 2017, 15:58:44 UTC
1 parent 06b249d
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