Skip to content

Instantly share code, notes, and snippets.

View email2vimalraj's full-sized avatar
🎯
Focusing

VimalRaj Selvam email2vimalraj

🎯
Focusing
View GitHub Profile
@email2vimalraj
email2vimalraj / pre-commit-eslint
Created December 27, 2017 12:53 — 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