Skip to content

Docs: Remove readonly/writable global logic from no-undef (fixes #11963)#12053

Merged
platinumazure merged 2 commits intoeslint:masterfrom
mdjermanovic:issue11963
Aug 6, 2019
Merged

Docs: Remove readonly/writable global logic from no-undef (fixes #11963)#12053
platinumazure merged 2 commits intoeslint:masterfrom
mdjermanovic:issue11963

Conversation

@mdjermanovic
Copy link
Copy Markdown
Member

What is the purpose of this pull request? (put an "X" next to item)

[X] Documentation update #11963

What changes did you make? (Give an overview)

Removed an example that does not apply to this rule.

Removed writable flag as it's irrelevant for this rule.

Modified a 'write' example (b = 10) to 'read' example (var bar = a + 1).

Is there anything you'd like reviewers to focus on?

Should there be a 'correct' example like this:

/*global b*/
/*eslint no-undef: "error"*/
b = 10;

It is indeed a correct code for this rule, but it isn't the right way to use eslint global variables in general.

@eslint-deprecated eslint-deprecated Bot added the triage An ESLint team member will look at this issue soon label Aug 2, 2019
@aladdin-add aladdin-add added accepted There is consensus among the team that this change meets the criteria for inclusion documentation Relates to ESLint's documentation rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Aug 3, 2019
Copy link
Copy Markdown
Member

@aladdin-add aladdin-add 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!

Copy link
Copy Markdown
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

The changes already present LGTM, thanks!

I think we should add a "See Also" section that links to no-redeclare and/or no-implicit-globals, as needed. Additionally, the descriptions should name the rules which do handle global writes.

@mdjermanovic
Copy link
Copy Markdown
Member Author

The changes already present LGTM, thanks!

I think we should add a "See Also" section that links to no-redeclare and/or no-implicit-globals, as needed. Additionally, the descriptions should name the rules which do handle global writes.

It's done now, please check is it ok.

I thought the convention is not to mention other rules except in the Related Rules section, but I see now there are many examples like this, and it makes sense of course when it is important.

Copy link
Copy Markdown
Member

@platinumazure platinumazure 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!

Copy link
Copy Markdown
Member

@kaicataldo kaicataldo 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 for contributing!

Copy link
Copy Markdown
Member

@g-plane g-plane 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!

@platinumazure platinumazure merged commit fb08b7c into eslint:master Aug 6, 2019
@platinumazure
Copy link
Copy Markdown
Member

Merged! Thanks @mdjermanovic for contributing!

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 documentation Relates to ESLint's documentation rule Relates to ESLint's core rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants