help wantednew rule
仓库指标
- 星标
- (5,022 个星标)
- PR 合并指标
- (平均合并 4小时 30分钟) (30 天内合并 26 个 PR)
描述
Description
Iterator#toArray() is more clear to me that coverts iterator to array than [...iterator], especially when iterator is a long expression.
Examples
// ❌
[...map.values()].map(value => value * 2)
// ✅
map.values().toArray().map(value => value * 2)
map.values().map(value => value * 2).toArray()
Proposed rule name
prefer-iterator-to-array
Additional Info
Full list of Iterators https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator#description