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

markelog opened this issue May 10, 2016 · 1 comment


Copy link

@markelog markelog commented May 10, 2016

What version of ESLint are you using?

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

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
Copy link

@mysticatea 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-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants