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

Fix: one-var allows uninitialized vars in ForIn/ForOf (fixes #5744) #6272

Merged
merged 1 commit into from Jun 5, 2016

Conversation

kaicataldo
Copy link
Member

No description provided.

@eslintbot
Copy link

LGTM

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @IanVS, @gyandeeps and @vitorbal to be potential reviewers

@@ -400,14 +450,6 @@ ruleTester.run("one-var", rule, {
},
{
code: "var i = [0], j;",
options: [ { initialized: "never" } ],
Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like this is a duplicate test

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, never mind

@eslintbot
Copy link

LGTM

@nzakas
Copy link
Member

nzakas commented Jun 1, 2016

Code looks good. Can you add something to the docs?

@kaicataldo
Copy link
Member Author

Oh yeah - sure thing!

@kaicataldo kaicataldo force-pushed the fixes5744 branch 6 times, most recently from 142bac8 to f02e9bc Compare June 3, 2016 04:08
@kaicataldo kaicataldo changed the title Fix: ignore uninitialized vars in ForIn/ForOf statements (fixes #5744) Fix: one-var allows uninitialized vars in ForIn/ForOf (fixes #5744) Jun 3, 2016
@eslintbot
Copy link

LGTM

@kaicataldo
Copy link
Member Author

Updated with changes to the docs

@@ -203,6 +203,8 @@ function foo() {

When configured with an object as the first option, you can individually control how `var`, `let`, and `const` are handled, or alternatively how `uninitialized` and `initialized` variables are handled (which if used will override `var`, `let`, and `const`).

**Note:** A variable declared in a for-in or for-of loop will NOT be flagged with the option `{ uninitialized: "always" }`, as this value is determined by the loop.
Copy link
Member

Choose a reason for hiding this comment

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

Can you change "NOT" to lowercase (we don't do this anywhere else)?

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 yeah, no problem

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@eslintbot
Copy link

LGTM

@nzakas
Copy link
Member

nzakas commented Jun 5, 2016

Lgtm

@nzakas nzakas merged commit 316a507 into master Jun 5, 2016
@kaicataldo kaicataldo deleted the fixes5744 branch June 5, 2016 18: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

5 participants