Skip to content

Instantly share code, notes, and snippets.

@eschaefer
Last active June 2, 2017 13:56
Show Gist options
  • Save eschaefer/37af52b3cf5492dddb51aab5f5111935 to your computer and use it in GitHub Desktop.
Save eschaefer/37af52b3cf5492dddb51aab5f5111935 to your computer and use it in GitHub Desktop.
Linting only staged JS files

Lint all staged .js and .jsx files

git diff --cached --diff-filter=ACMRTUXB --pretty='format:' --name-only | grep -E .jsx?\\?$ | xargs node_modules/eslint/bin/eslint.js --quiet --ext .jsx,.js

Lint all staged .scss files

git diff --name-only --staged --diff-filter=ACMRTUXB --relative | grep -E .scss\\?$ | xargs --no-run-if-empty node_modules/sass-lint/bin/sass-lint.js -v --max-warnings 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment