https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 8a90513865bfc5ef0fff9e1ee7ededa6379a0fb8 authored by Nicolas Thouvenin on 06 April 2020, 19:34:26 UTC
11.11.0
Tip revision: 8a90513
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