sindresorhus/eslint-plugin-unicorn

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

已關閉

#295 建立於 2019年5月8日

 (18 則留言) (1 個反應) (0 位負責人)JavaScript (468 個分叉)user submission
:dollar: Funded on Issuehuntenhancementhelp wanted

倉庫指標

星標
 (5,022 顆星)
PR 合併指標
 (平均合併 4小時 30分鐘) (30 天內合併 26 個 PR)

描述

/* 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

貢獻者指南