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

New: no-global-assign rule (fixes #6586) #6746

Merged
merged 1 commit into from Aug 1, 2016
Merged

New: no-global-assign rule (fixes #6586) #6746

merged 1 commit into from Aug 1, 2016

Conversation

alberto
Copy link
Member

@alberto alberto commented Jul 22, 2016

What issue does this pull request address?
#6586

What changes did you make? (Give an overview)
Duplicate and rename no-native-reassign to no-global-assign and mark the former as deprecated.

Is there anything you'd like reviewers to focus on?
Let me know if the deprecation messages are enough and if the commit message and tag are correct for this kind on change.

@eslintbot
Copy link

LGTM

@mention-bot
Copy link

@alberto, thanks for your PR! By analyzing the annotation information on this pull request, we identified @mysticatea, @jrajav and @nzakas to be potential reviewers

@@ -1,6 +1,7 @@
/**
* @fileoverview Rule to flag adding properties to native object's prototypes.
* @author David Nelson
* @deprecated in ESLint v3.2.0
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I don't remember what did we decide. Do we just leave the old rule unchanged, or should we remove all of the code and just do module.exports = require('./no-global-assign');? I guess former, since we don't want new changes to the rule to be propagated to deprecated version.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that's what we decided in #6586 (comment)

@mysticatea
Copy link
Member

Oh, we should deprecate no-native-reassign rule, not no-extend-native rule.

@mysticatea
Copy link
Member

Is the deprecated rule removed from rule list page?

@alberto
Copy link
Member Author

alberto commented Jul 23, 2016

Oh, we should deprecate no-native-reassign rule, not no-extend-native rule.

Oops! 😅

Is the deprecated rule removed from rule list page?

No. I don't think it should be removed since it's still available and actually part of eslint:recommended. I added (deprecated) to the description. We could also group the deprecated rules, similarly to the removed ones, but maybe we should open a new issue for that?

@alberto alberto changed the title New: no-global-assign rule (fixes #6585) New: no-global-assign rule (fixes #6586) Jul 23, 2016
@eslintbot
Copy link

LGTM

@mysticatea
Copy link
Member

Looks good to me. Thank you!

@nzakas
Copy link
Member

nzakas commented Jul 25, 2016

We also need to figure out where to list deprecated rules and add a deprecation notice to the rule docs. Possibly, we should add this into the rule meta too. @ilyavolodin @pedrottimark thoughts on that?

docs: {
description: "disallow assignments to native objects or read-only global variables",
category: "Best Practices",
recommended: true
Copy link
Member

Choose a reason for hiding this comment

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

Not actually recommended, correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, you are right

@ilyavolodin
Copy link
Member

Yes, I think deprecated should become another meta property. I think @mysticatea already assumed as such with his PR for eslint:all

@platinumazure
Copy link
Member

I'm 👍 on meta.deprecated unless that will raise some other problem I'm not aware of.

@vitorbal
Copy link
Member

I would be willing to help out with this issue if no one minds. I also had
in my radar generating the deprecated rules list for the rules index page,
unless you're already on that, @ilyavolodin?
On Mon, Jul 25, 2016 at 9:32 PM Kevin Partington notifications@github.com
wrote:

I'm 👍 on meta.deprecated unless that will raise some other problem I'm
not aware of.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#6746 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAmNdnQYXLIy0_pAHjsWUOVNaAEIFxTKks5qZQ9XgaJpZM4JTGV0
.

@ilyavolodin
Copy link
Member

@vitorbal No, it's all yours.

@alberto
Copy link
Member Author

alberto commented Jul 26, 2016

@nzakas do you want me to address the rules list generation as part of this PR? Or what do you intend to do @vitorbal?

@eslintbot
Copy link

LGTM

@alberto
Copy link
Member Author

alberto commented Jul 26, 2016

I have updated the PR with the suggestions above and added a new section deprecated in conf/category-list.json

@vitorbal now that I had a look at how the generation is done, I realized that maybe you referred to the changes in the site repo?

Let me know if there is anything else needed here

@vitorbal
Copy link
Member

vitorbal commented Jul 27, 2016

@alberto I think you actually got it covered now with your latest commits.
As for the site repo, I don't have much experience there yet, but I can give it a shot! From what I can see the only thing missing would be to add the list of deprecated rules in docs/rules/index.md?

edit: Ok, I think I figured it out. I will send a PR in the site repo for adding the list of deprecated rules in docs/rules/index.md!

@@ -8,6 +8,13 @@
{ "name": "Stylistic Issues", "description": "These rules relate to style guidelines, and are therefore quite subjective:" },
{ "name": "ECMAScript 6", "description": "These rules relate to ES6, also known as ES2015:" }
],
"deprecated": {
"name": "Deprecated",
"description": "These rules have been deprecated and replaced by newer rules.",
Copy link
Member

Choose a reason for hiding this comment

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

For the "removed" rules we end the description with a colon instead of a dot. Should we do the same here for consistency?

@@ -209,6 +209,10 @@ function generateRuleIndexPage(basedir) {
find(path.join(basedir, "/lib/rules/")).filter(fileType("js")).forEach(function(filename) {
var rule = require(filename);

if (rule.meta.deprecated) {
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to skip this entirely? Shouldn't there be a category for that?

Copy link
Member

Choose a reason for hiding this comment

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

We could add it to the categoriesData.deprecated.rules array here instead of doing it manually in https://github.com/eslint/eslint/pull/6746/files#r72645142

Copy link
Member

Choose a reason for hiding this comment

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

I think that is a good idea. Less manual work is always preferable.

@eslintbot
Copy link

LGTM

@alberto
Copy link
Member Author

alberto commented Jul 29, 2016

PR updated with suggestions from above.

@eslintbot
Copy link

LGTM

@vitorbal
Copy link
Member

Lgtm

@nzakas
Copy link
Member

nzakas commented Aug 1, 2016

LGTM

@nzakas nzakas merged commit 2b17459 into master Aug 1, 2016
@alberto alberto deleted the issue6585 branch August 2, 2016 01:08
@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
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants