https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 371109276e68dc680cc284f7df2a2f36ca65858a authored by Nicolas Thouvenin on 24 July 2020, 08:25:46 UTC
11.13.1
Tip revision: 3711092
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