https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 12836c815dc7e4e9c328ee7591adb18b7df77348 authored by Kmaschta on 15 October 2018, 08:29:27 UTC
v8.24.1
Tip revision: 12836c8
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