Skip to content

Instantly share code, notes, and snippets.

@zmackie
Forked from oroce/package.json
Created November 18, 2017 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zmackie/0970f46d3b9be5bd00a6898973a9415e to your computer and use it in GitHub Desktop.
Save zmackie/0970f46d3b9be5bd00a6898973a9415e to your computer and use it in GitHub Desktop.
run eslint only on changed (*.js files) files using pre-commit
{
"scripts": {
"eslint": "LIST=`git diff-index --name-only HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi"
},
"devDependencies": {
"pre-commit": "0.0.7",
"eslint": "~0.5.1"
},
"pre-commit": [
"eslint"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment