https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: b3762a2e4b8aea417db939960a352ccb23c8c97d authored by Florian Ferbach on 18 December 2020, 09:42:39 UTC
Merge pull request #1177 from Inist-CNRS/version12.0.10
Tip revision: b3762a2
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