eslint-plugin-no-loops

0.4.0 • Public • Published

eslint-plugin-no-loops

It's 2024 and you still use loops?

Build Status npm

Installation

npm install --save-dev eslint-plugin-no-loops

Usage

In your .eslintrc:

{
  "plugins": [
    "no-loops"
  ],
  "rules": {
    "no-loops/no-loops": 2
  }
}

Rule

Disallow use of loops (for, for-in, while, do-while, for-of).

Why

You don't need them.

I know better, I need one now

If 99% of your code doesn't need them, but you have that single case where a loop makes sense, go ahead!

// eslint-disable-next-line no-loops/no-loops
for (let i = 0; i < arr.length; i++) {
  // ...
}

What is a rule without its exceptions?

Readme

Keywords

none

Package Sidebar

Install

npm i eslint-plugin-no-loops

Weekly Downloads

21,191

Version

0.4.0

License

MIT

Unpacked Size

4.79 kB

Total Files

7

Last publish

Collaborators

  • pedrodim
  • marcopiii
  • gabro
  • veej
  • giogonzo
  • tpetrucciani
  • malpenzibo
  • federico.ercoles