https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: e0935472ab12a9a58845dc2db0634e6b60fbc37a authored by Anthony Rimet on 26 January 2023, 20:48:56 UTC
12.37.0
Tip revision: e093547
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