https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: e357ea6734ddcdab203b6a3364be3f9788ec64e9 authored by Nicolas Thouvenin on 22 March 2019, 09:18:32 UTC
9.5.10
Tip revision: e357ea6
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