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

Incorrect behaviour of "no-unused-vars" rule when variable defined outside of the loop #6125

Closed
markelog opened this issue May 10, 2016 · 1 comment
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion triage An ESLint team member will look at this issue soon

Comments

@markelog
Copy link
Member

What version of ESLint are you using?
2.9.0

What parser (default, Babel-ESLint, etc.) are you using?
default

Please show your full configuration:

{
    "rules": {
        "no-unused-vars": "error"
    }
}

What did you do? Please include the actual source code causing the issue.
run eslint on the following code -

(function( obj ) {
    var name;

    for ( name in obj ) {
        return false;
    }
    return true;
});

What did you expect to happen?
No errors

What actually happened? Please include the actual, raw output from ESLint.

2:6  error  'name' is defined but never used  no-unused-vars
@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label May 10, 2016
@mysticatea
Copy link
Member

Thank you for this issue.

Closing as a duplicate of #2342.
Please track that issue.

@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 triage An ESLint team member will look at this issue soon
Projects
None yet
Development

No branches or pull requests

3 participants