Skip to content

Instantly share code, notes, and snippets.

@krotscheck
Forked from oroce/package.json
Last active December 2, 2015 17:18
Show Gist options
  • Save krotscheck/2a6212c822957fb7f1fd to your computer and use it in GitHub Desktop.
Save krotscheck/2a6212c822957fb7f1fd 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~1 | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi"
},
"devDependencies": {
"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