https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 46c3e393ea8320098c4e1da1c1a6dff031a81fe9 authored by Nicolas Thouvenin on 11 January 2019, 15:59:41 UTC
9.4.3
Tip revision: 46c3e39
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