https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: f4838c124ef1dfaf62ba352a7d13f62f70123fb8 authored by Nicolas Thouvenin on 09 September 2020, 15:18:14 UTC
11.15.0
Tip revision: f4838c1
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