Skip to content
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

Merged
merged 7 commits into from Jun 26, 2020

Conversation

mcdado
Copy link
Contributor

@mcdado mcdado commented Jan 13, 2020

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:

/*eslint camelcase: ["error", {ignoreGlobals: false}]*/
/* global some_property */

const property = some_property;

Examples of correct code for this rule with the { "ignoreGlobals": true } option:

/*eslint camelcase: ["error", {ignoreGlobals: true}]*/
/* global some_property */

const property = some_property;

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.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Jan 13, 2020
@jsf-clabot
Copy link

jsf-clabot commented Jan 13, 2020

CLA assistant check
All committers have signed the CLA.

lib/rules/camelcase.js Outdated Show resolved Hide resolved
@mcdado mcdado marked this pull request as ready for review January 13, 2020 17:00
Copy link

@mightyiam mightyiam left a 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.

@aladdin-add aladdin-add added enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Jan 14, 2020
@mcdado
Copy link
Contributor Author

mcdado commented Jan 14, 2020

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.

@mcdado mcdado force-pushed the camelcase-ignore-globals branch 2 times, most recently from 1b3838b to feeebee Compare January 14, 2020 17:23
@kaicataldo
Copy link
Member

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.

@mcdado
Copy link
Contributor Author

mcdado commented Jan 14, 2020

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. :)

@kaicataldo kaicataldo changed the title Add option "ignoreGlobals" to camelcase rule Update: Add option "ignoreGlobals" to camelcase rule (fixes #11716) Jan 14, 2020
@mcdado
Copy link
Contributor Author

mcdado commented May 28, 2020

This world be nice to merge 😉

@kaicataldo
Copy link
Member

@eslint/eslint-team We need a champion and one more 👍 to accept this proposal. If not, it's probably time to close this PR.

@mdjermanovic mdjermanovic self-assigned this Jun 13, 2020
@mdjermanovic
Copy link
Member

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.

@nzakas
Copy link
Member

nzakas commented Jun 16, 2020

Okay I’ll 👍 to put it over the top. @mdjermanovic can you review this PR?

lib/rules/camelcase.js Outdated Show resolved Hide resolved
lib/rules/camelcase.js Outdated Show resolved Hide resolved
@mdjermanovic mdjermanovic added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Jun 16, 2020
lib/rules/camelcase.js Outdated Show resolved Hide resolved
lib/rules/camelcase.js Outdated Show resolved Hide resolved
Copy link
Member

@mdjermanovic mdjermanovic left a 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.

docs/rules/camelcase.md Outdated Show resolved Hide resolved
lib/rules/camelcase.js Outdated Show resolved Hide resolved
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@kaicataldo kaicataldo merged commit 51e42ec into eslint:master Jun 26, 2020
@kaicataldo
Copy link
Member

Thanks for contributing!

@mcdado mcdado deleted the camelcase-ignore-globals branch June 26, 2020 21:16
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Dec 24, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Dec 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants