https://github.com/Inist-CNRS/lodex
Raw File
Tip revision: 81ad060b8fd9ca019104b0d6a9c3b6819031dd38 authored by JulienM on 19 October 2023, 11:40:16 UTC
14.0.13
Tip revision: 81ad060
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