Skip to content

Instantly share code, notes, and snippets.

@daftAnorak
Created February 15, 2017 23:55
Show Gist options
  • Select an option

  • Save daftAnorak/f5bc2318f10f0fad5415d91956b89b51 to your computer and use it in GitHub Desktop.

Select an option

Save daftAnorak/f5bc2318f10f0fad5415d91956b89b51 to your computer and use it in GitHub Desktop.
Run eslint against a git commit (in this case, `HEAD`). Usually needed when migrating code that doesn't already have a lint.
# !/bin/bash
FILES=`{ git diff --name-only HEAD; \
git ls-files --others --exclude-standard; } \
| grep '\.js$' \
| grep -v '^.*exclude-folder.*$'`
node_modules/.bin/eslint $FILES -f table --color --quiet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment