Incorrect behaviour of "no-unused-vars" rule when variable defined outside of the loop #6125
Closed
Description
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