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
Fix: no-restricted-syntax - correct the schema #12051
Conversation
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 contributing!
Is this testable? Answer might be no. But it's always good to see if we could avoid regressions here.
Unfortunately it's not. If you run the rule tester with a config that goes against the schema, it'll just throw an error and fail the test. Could potentially add tests outside of the standard rule testing tooling - up to you if you think that's a good idea. I only found the issue because I've been doing some work to automatically generate typescript types based off of the rule's json schema. I've found rules in other plugins which had similar invalid schemas. |
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 for contributing!
Thanks @bradzacher for the explanation, as well as digging in and finding these issues. I don't think it's critical to add tests at this time, but other team members may think otherwise. |
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!
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!
What is the purpose of this pull request? (put an "X" next to item)
[x] Bug fix (template)
What did you do? Please include the actual source code causing the issue.
configured the rule invalidly:
What did you expect to happen?
eslint fails with a configuration validation errors
What actually happened? Please include the actual, raw output from ESLint.
the rule ran fine with no errors.
For reference, running the current schema through jsonschemavalidator.net:

Running the new schema through jsonschemavalidator.net:

Running a lint with the new schema: