sindresorhus/eslint-plugin-unicorn

A case not handled by `no-for-loop`

クローズ

#295 opened on 2019/05/08

 (18 件のコメント) (1 件のリアクション) (0 人の担当者)JavaScript (468 件のフォーク)user submission
:dollar: Funded on Issuehuntenhancementhelp wanted

Repository metrics

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

説明

/* eslint unicorn/no-for-loop: 2 */

const arr = [];

for (let i = 0, j = arr.length; i < j; i += 1) {
  const element = arr[i];
  console.log(element);
}

no-for-loop should report on this but it does not.

This slightly unusual pattern is used all over the place in eslint-plugin-react.

This issue is a subtask of #250.


Backers (Total: $40.00)

Submitted pull Requests


Become a backer now!

Or submit a pull request to get the deposits!

Tips

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