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
New: Add prefer-regex-literals rule (fixes #12238) #12254
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.
Some minor documentation tweaks and one question.
Also, I wanted to note that you can pass parserOptions
to the RuleTester
constructor, and have them be the default on all tests. I don't personally think there is much value in having the parserOptions set for each test since, if the user tried to use template literals without the right ecmaVersion, the rule wouldn't even run. So, if you want to save some lines, you could pass parserOptions: { ecmaVersion: 2015 }
to the RuleTester
constructor. But I don't feel strongly about this at all.
Co-Authored-By: Kevin Partington <platinum.azure@kernelpanicstudios.com>
Co-Authored-By: Kevin Partington <platinum.azure@kernelpanicstudios.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, thank you!
What is the purpose of this pull request? (put an "X" next to item)
[X] New rule #12238
Examples of incorrect code for this rule:
Examples of correct code for this rule:
What changes did you make? (Give an overview)
Added new rule
prefer-regex-literals
Is there anything you'd like reviewers to focus on?