https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 5d901aca3bde39cfcd405f154245d09bc6c35584 authored by Anthony Rimet on 26 October 2021, 15:16:25 UTC
12.4.4
Tip revision: 5d901ac
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