Skip to content

Instantly share code, notes, and snippets.

@krotscheck
krotscheck / package.json
Last active Dec 2, 2015 — forked from oroce/package.json
run eslint only on changed (*.js files) files using pre-commit
View package.json
{
"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"
]