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

Rename "no-native-reassign" to "no-global-assign" #6586

Closed
jacksonrayhamilton opened this issue Jul 3, 2016 · 10 comments
Closed

Rename "no-native-reassign" to "no-global-assign" #6586

jacksonrayhamilton opened this issue Jul 3, 2016 · 10 comments
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 core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint

Comments

@jacksonrayhamilton
Copy link
Contributor

As mentioned in #6395, the name of the rule "no-native-reassign" is confusing, because the rule covers more than native reassignments. The name was so misleading that no one realized the rule worked the way it did for several months. Therefore, I think the rule should be renamed to "no-global-assign".

One issue brought up in that thread was that a name change would be breaking. It doesn't have to be; we could have the old name (and docs url) alias the new one, promote the new name wherever possible, and mention the alias in the rule's documentation. Aliasing could be automated with metadata.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Jul 3, 2016
@platinumazure platinumazure added enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules breaking This change is backwards-incompatible evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Jul 3, 2016
@platinumazure
Copy link
Member

With our current infrastructure, this is a breaking change. If the necessary infrastructure changes are done to support aliasing (requires separate issue, discussion for acceptance, and pull request), then I'll remove the "breaking" label.

I'm personally 👍 for this change, even if we do it as a breaking change. The name of the rule right now is just plain wrong (IMO).

@nzakas nzakas added core Relates to ESLint's core APIs and features and removed rule Relates to ESLint's core rules labels Jul 4, 2016
@nzakas
Copy link
Member

nzakas commented Jul 4, 2016

We don't currently have a way of aliasing rules, so this is really a core enhancement request.

@nzakas nzakas added tsc agenda This issue will be discussed by ESLint's TSC at the next meeting accepted There is consensus among the team that this change meets the criteria for inclusion and removed breaking This change is backwards-incompatible evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion tsc agenda This issue will be discussed by ESLint's TSC at the next meeting labels Jul 4, 2016
@nzakas
Copy link
Member

nzakas commented Jul 7, 2016

Per TSC meeting, we agree that we should rename no-native-reassign to no-global-reassign for clarity. The no-native-reassign rule will be deprecated and fall under our regular deprecation policy (so as to avoid a breaking change).

This involves:

  1. Copying all no-native-reassign files to corresponding no-global-reassign files
  2. Making no-native-reassign.js just contain module.exports = require("./no-global-reassign") (similar for the tests)
  3. Add no-native-reassign to deprecated section on website (design needed)

@jacksonrayhamilton
Copy link
Contributor Author

Just to clarify, will the rule be called no-global-assign or no-global-reassign? (In the meeting notes the former is used, but in your comment above the latter is used.)

@ghost
Copy link

ghost commented Jul 7, 2016

Can Proxies solve this issue? Not used them now but I can imagine Proxies are helpful in such a case.

@nzakas
Copy link
Member

nzakas commented Jul 8, 2016

@jacksonrayhamilton ooh, nice catch, I completely missed that. I think no-global-assign makes more sense.

@fibric proxies do not help this use case.

@alberto
Copy link
Member

alberto commented Jul 13, 2016

@nzakas should we import the new one instead of just copying it? If it is deprecated, leaving the old copy intact seems reasonable to me. It shouldn't get future changes by means of the new rule.

@nzakas
Copy link
Member

nzakas commented Jul 15, 2016

@alberto hmmm, good point. My concern was that having two rules that are the same would be confusing in the code base , but I suppose we can solve that by putting a deprecation comment at the top of the file.

@alberto
Copy link
Member

alberto commented Jul 21, 2016

There is a problem with this. no-native-reassign is part of eslint:recommended so I guess we can't disable it until next major? Should we create no-global-assign and replace it then?

@nzakas
Copy link
Member

nzakas commented Jul 22, 2016

We weren't going to disable it, only deprecate it, so that shouldn't affect anyone.

This is also why I thought having one rule reference the other was a good idea, so the references act the same.

In any case, we can't change eslint: recommended until the next major version.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@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 Feb 6, 2018
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 core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint
Projects
None yet
Development

No branches or pull requests

5 participants