sindresorhus/eslint-plugin-unicorn

`no-array-for-each`: False positive with non-arrays

クローズ

#1,788 opened on 2022/04/02

 (4 件のコメント) (1 件のリアクション) (0 人の担当者)JavaScript (468 件のフォーク)user submission
bughelp wantedtypes

Repository metrics

Stars
 (5,022 個のスター)
PR merge metrics
 (平均マージ 4h 30m) (30d で 26 merged PRs)

説明

Here CB is an object with a bunch of functions on it. The forEach function has nothing to do arrays but gets flagged.

import * as CB from "strict-callbag-basics";

CB.pipe(
  CB.interval(1000),
  CB.map(x => x + 1),
  CB.filter(x => x % 2),
  CB.take(5),
  CB.forEach(x => console.log(x))
);

コントリビューターガイド