https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: f8c7dea56358c297ad7d328f4c4c2100ea926c61 authored by Matthieu Chaffotte on 12 December 2019, 15:42:12 UTC
Merge pull request #1036 from Inist-CNRS/releases/v11.7.1
Tip revision: f8c7dea
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