Skip to content

Instantly share code, notes, and snippets.

@erikdstock
Forked from kadamwhite/lint-diff-package.json
Last active May 2, 2017 21:04
Show Gist options
  • Save erikdstock/468c1bd1e5cedb24807efcf2d26695b6 to your computer and use it in GitHub Desktop.
Save erikdstock/468c1bd1e5cedb24807efcf2d26695b6 to your computer and use it in GitHub Desktop.
Use `git diff` and `grep` to selectively lint changed files
{
"scripts": {
"jshint:branch": "jshint $(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base head master) | grep '.js$') || true",
"jshint:diff": "jshint $(git diff --name-only --diff-filter=ACMRTUXB | grep '.js$') || true",
"jshint:prev": "jshint $(git diff head~1 --name-only --diff-filter=ACMRTUXB | grep '.js$') || true",
"coffeelint:diff": "coffeelint $(git diff --name-only --diff-filter=ACMRTUXB | grep '.coffee$') || true"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment