New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: skip running warnings in --quiet mode #17274
Conversation
Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update. |
Not stale. Work in progress. |
Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update. |
Sorry am still working on it; have been a bit busy and given this is blocked by the next major release it’s not too high on my list of priorities as I’m assuming that’s still at least a little while away - I’ll try to finish it up sometime soonish then rebase it every so often to keep the bot happy |
Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update. |
Not stale sorry, I’ve been fairly busy |
Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update. |
ca15aa6
to
d7f3918
Compare
✅ Deploy Preview for docs-eslint canceled.
|
Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update. |
57ee39c
to
451edeb
Compare
44f46c5
to
bd74353
Compare
bd74353
to
acff363
Compare
I believe this should be ready for review. I looked over it and wrote some tests to validate that the |
3ac45d7
to
90136a6
Compare
90136a6
to
c93df94
Compare
As it seems some breaking changes for v9 are now in the main branch, should I mark this ready for review? |
Yes, I marked this as ready for review now. |
Okay, I think it's acceptable but it would be better to avoid it if possible. Something like @me4502 suggested in #17274 (comment) might be the solution. However, given the complexity, I think this should be revisited at some later point (not in this PR). Also, it seems that the same problem exists with some other CLI options (e.g., |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! Leaving open for @nzakas to verify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename to eslint.config-rule-throws.js
? We generally don't have underscores in filenames.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I'm blocked, I'm going to go ahead and merge this and then handle the file renaming myself.
Thanks so much for sticking with this feature @me4502! 🙏
Yeah no worries, I think those snuck in at some point so I understand the confusion. |
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[X] Add something to the core
[ ] Other, please explain:
https://github.com/eslint/rfcs/tree/main/designs/2023-only-run-reporting-rules
Fixes #16450
What changes did you make? (Give an overview)
This PR implements the RFC around only running rules that actually report information in quiet mode. This adds a predicate function that is passed down to the runRules function that filters out all non-error rules when the
--quiet
flag is entered andmaxWarnings
is not in use. All rules returning false from the predicate function are skipped during rule running.TODO:
I believe the
--max-warnings
flag handling is already covered by the existing tests, as from a test perspective it only cares about if it still works with quiet mode (everything else is an implementation detail). I've added tests that theruleFilter
option does actually filter out rules to the linter.Is there anything you'd like reviewers to focus on?