Revision b459800d49c208b0d972fa5f6585b16cdd5c379f authored by Luwangel on 02 January 2020, 16:07:01 UTC, committed by Luwangel on 02 January 2020, 16:07:01 UTC
1 parent 2cb5de7
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