Open karlcow opened 7 years ago
Ah maybe a hint in https://gist.github.com/jhartikainen/36a955f3bfe06557e16e#gistcomment-1990800
"lint-staged": "eslint `git diff --staged --diff-filter=AM --name-only | grep .js$ | tr '\n' ' '`"
Let's add a comment on a python file. Removing --staged
→ git diff --diff-filter=AM --name-only
config/environment.py
→ git diff --diff-filter=AM --name-only | grep .js$ | tr '\n' ' '
# returns nothing. Cool!
Let's do the same in a JS.
→ git diff --diff-filter=AM --name-only
config/environment.py
webcompat/static/js/lib/diagnose.js
→ git diff --diff-filter=AM --name-only | grep .js$ | tr '\n' ' '
webcompat/static/js/lib/diagnose.js
Yeah working!
Steps to reproduce:
Actual: linter for JS and CSS are running. Expected: don't do things I don't need.
Could we just activate this when the files to commit are actually from the lint-checker family.
Example: