📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

eslint-plugin-no-loops

Package Overview
Dependencies
Maintainers
7
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-no-loops

Disallow loops

0.4.0
latest
Source
npm
Version published
Weekly downloads
20K
32.55%
Maintainers
7
Weekly downloads
 
Created
Source

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?

FAQs

Package last updated on 13 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts