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
Update: Add option "ignoreGlobals" to camelcase rule (fixes #11716) #12782
Conversation
b08d262
to
939f30a
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.
I'm not a member of this project, but at the very least it seems that this requires a test.
I could commit a broken test... I made a comment asking for input on how to achieve this, since I'm not familiar with the code base and I just tried to look around for hints. The committed code at the moment does not pass a test. |
1b3838b
to
feeebee
Compare
Thanks for making this PR. This seems like a reasonable change to me, and I support this proposal. Please note that this repository follows a process for accepting proposals and we won't be able to merge this until we have reached consensus within the team. We generally recommend making an issue to discuss design and implementation before making a PR, to save people time in case it doesn't get accepted. You can read more about this process here. |
Thanks. I had found #11716 but I was interested and motivated enough to make this happen. I hope this can go through. :) |
This world be nice to merge 😉 |
@eslint/eslint-team We need a champion and one more 👍 to accept this proposal. If not, it's probably time to close this PR. |
I'm willing to champion this. This is a new option in a stylistic rule, but I personally think it's more a bug fix than an enhancement. |
Okay I’ll 👍 to put it over the top. @mdjermanovic can you review this PR? |
feeebee
to
3381d1a
Compare
3381d1a
to
4e61c59
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 the changes! This looks good, just two minor notes.
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!
Thanks for contributing! |
What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[X] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
Added an option to ignore global variables in the camelcase rule.
Is there anything you'd like reviewers to focus on?
Testing the change and add tests.
What rule do you want to change?
camelcase
Does this change cause the rule to produce more or fewer warnings?
fewer
How will the change be implemented? (New option, new default behavior, etc.)?
New option
Please provide some example code that this change will affect:
Examples of incorrect code for this rule with the default
{ "ignoreGlobals": false }
option:Examples of correct code for this rule with the
{ "ignoreGlobals": true }
option:What does the rule currently do for this code?
Returns an error.
What will the rule do after it's changed?
Offer an option to ignore the error.