https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: edbb8635c06b356e1334c9c3d687ca3dedb42c28 authored by Nicolas Thouvenin on 16 January 2020, 14:44:22 UTC
11.9.3
Tip revision: edbb863
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