lint-staged: Duplicated errors
@okonet thank you for the package.
I got duplicates in output while trying to use link-staged with husky, here’s my config:
"scripts": {
"precommit": "lint-staged"
},
"lint-staged": {
"gitDir": "../../",
"linters": {
"app/front-end/src/**/*.{js,jsx}": "eslint --quiet"
}
},
Output:
> husky - npm run -s precommit
[?25l[13:18:41] Running tasks for app/front-end/src/**/*.{js,jsx} [started]
[13:18:41] eslint --quiet [started]
[13:18:42] eslint --quiet [failed]
[13:18:42] → 🚫 eslint --quiet found some errors. Please fix them and try committing again.
/path/app/front-end/src/redux/actions/facebook.js
32:24 error 'createAcffgtion' is not defined no-undef
✖ 1 problem (1 error, 0 warnings)
[13:18:42] Running tasks for app/front-end/src/**/*.{js,jsx} [failed]
[13:18:42] → 🚫 eslint --quiet found some errors. Please fix them and try committing again.
/path/app/front-end/src/redux/actions/facebook.js
32:24 error 'createAcffgtion' is not defined no-undef
✖ 1 problem (1 error, 0 warnings)
[?25h🚫 eslint --quiet found some errors. Please fix them and try committing again.
/path/app/front-end/src/redux/actions/facebook.js
32:24 error 'createAcffgtion' is not defined no-undef
✖ 1 problem (1 error, 0 warnings)
[?25h
> husky - pre-commit hook failed (add --no-verify to bypass)
> husky - to debug, use 'npm run precommit'
Looks like lint-staged and husky both output the same error. Here I got 2 errors from lint-staged and one from husky.
Can we add some --silent option for lint-staged? So it would not output the errors, but throw them forward to husky (I also use husky for another lintings).
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 11
- Comments: 31
Commits related to this issue
- Fix duplicate error messages #142 Instead of throwing the error to the error method, we log it and pass an empty string to it. — committed to umarmw/lint-staged by umarmw 6 years ago
- Merge pull request #1 from umarmw/umarmw-patch-142 Fix duplicate error messages #142 — committed to umarmw/lint-staged by umarmw 6 years ago
Great, I’ll work on a PR with tests and all that this weekend. I want to know more about the TTY distinction and why it thinks my output channel isn’t a TTY.