-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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: improve flat config errors for invalid rule options and severities #17140
feat: improve flat config errors for invalid rule options and severities #17140
Conversation
✅ Deploy Preview for docs-eslint canceled.
|
8541c16
to
e724d97
Compare
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.
Thanks for taking a stab at this. In general, I think this is a good change. I'd just prefer to keep the original error message on the error objects themselves so we have consistency with how errors are reported in the code. Users won't end up seeing those errors messages anyway.
And yes, we don't test verbose error messages because those just bubble up to the CLI. We want to make sure that the thrown error matches the expectation and then we let the CLI do its thing to make those errors pretty.
Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
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! Just want @mdjermanovic to give this a review before merging.
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!
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:
What changes did you make? (Give an overview)
Adds a couple of new error messages for flat config schema parsing.
Fixes #17056
Is there anything you'd like reviewers to focus on?
Key: ...
portion of the error message, in favor of the traditionalConfiguration for rule ...
. I see this change as more readable, perhaps?