Skip to content

Instantly share code, notes, and snippets.

View drmercer's full-sized avatar

Dan Mercer drmercer

View GitHub Profile
drmercer / pre-commit
Last active April 19, 2017 21:12 — forked from wesbos/commit-msg
ESLint 3.0 Git Pre Commit Hook
View pre-commit
# Get a list of all JS files currently staged for commit
files=$(git diff --cached --name-only | grep '\.jsx\?$')
# Prevent ESLint help message if no files matched
if [ -z "$files" ] ; then
echo "(No JavaScript files to lint.)"
exit 0