https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 7239ab4bd1338e2461cc456238050ea8d4c2ad7c authored by Nicolas Thouvenin on 25 November 2022, 08:51:56 UTC
12.24.1
Tip revision: 7239ab4
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