Skip to content

Linter warns on unused for-of variable #2341

Open
@shicks

Description

@shicks

The following is a pain to do in any other way when iter is an arbitrary iterable:

let count = 0;
for (const unused of iter) count++;

But the linter warns that unused is never read. Possible workarounds would be (1) don't warn about unused variables whose names start with "unused", (2) possibly restrict this check to for-of variables.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions