https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 5c57b00fb7bde64f37abcd31741a0afb9d955ca2 authored by Nicolas Thouvenin on 23 February 2018, 09:22:36 UTC
8.18.0
Tip revision: 5c57b00
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