https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 7fd4651340e365395e8e89df506f55e3edf34b6d authored by Anthony Rimet on 01 December 2022, 16:36:33 UTC
12.4.6
Tip revision: 7fd4651
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