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

Comments

Projects
None yet
3 participants
@markelog
Member

markelog commented May 10, 2016

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 label May 10, 2016

@mysticatea

This comment has been minimized.

Member

mysticatea commented May 10, 2016

Thank you for this issue.

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

@mysticatea mysticatea closed this May 10, 2016

@eslint eslint bot locked and limited conversation to collaborators Feb 6, 2018

@eslint eslint bot added the archived due to age label Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.