google / google/closure-compiler
Linter warns on unused for-of variable
Open
lint
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
The following is a pain to do in any other way when `iter` is an arbitrary iterable:
```js
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.
Contributor guide
Assessment
This issue has not been assessed yet.