sindresorhus/eslint-plugin-unicorn

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

Chiusa

#295 aperta il 8 mag 2019

 (18 commenti) (1 reazione) (0 assegnatari)JavaScript (468 fork)user submission
:dollar: Funded on Issuehuntenhancementhelp wanted

Metriche repository

Star
 (5022 stelle)
Metriche merge PR
 (Merge medio 1g 16h) (399 PR mergiate in 30 g)

Descrizione

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

Guida contributor