https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 81d1359c4daeb63d29160d0d5aa23615f7b158bf authored by Anthony Rimet on 04 December 2023, 15:46:51 UTC
14.0.31
Tip revision: 81d1359
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