adametry / gulp-eslint

A Gulp plugin for identifying and reporting on patterns found in ECMAScript/JavaScript code.
MIT License
563 stars 118 forks source link

no-unused-vars if defined in for loop #241

Closed alishah-edgy closed 4 years ago

alishah-edgy commented 5 years ago
for (const key in block) {
  console.log(key);
}

it gives me error "error 'key' is defined but never used no-unused-vars"

silviuburceadev commented 4 years ago

I think this is an issue that belongs to ESLint directly.

alishah-edgy commented 4 years ago

Ok Thank you. For anyone who stumbles upon this same issue. Workaround is to define variable before loop. let key = null; for (key in block) { console.log(key); }