Skip to content

Instantly share code, notes, and snippets.

View JicLotus's full-sized avatar
🎯

Jose Castelli JicLotus

🎯
View GitHub Profile
@JicLotus
JicLotus / pre-commit-eslint
Created August 22, 2019 13:56 — forked from shettayyy/pre-commit-eslint
Pre-commit hook for Linting JS with ESLint before commit.
#!/bin/sh
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$")
ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint"
if [[ "$STAGED_FILES" = "" ]]; then
exit 0
fi
PASS=true