# eslint-plugin-no-loops

> Disallow loops

Latest version **0.4.0** (published 2024-06-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-no-loops
pnpm add eslint-plugin-no-loops
yarn add eslint-plugin-no-loops
bun add eslint-plugin-no-loops
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2024-06-13 |
| First published | 2016-01-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 130 |
| Author | buildo |
| Maintainers | marcopiii, gabro, veej, giogonzo, tpetrucciani, malpenzibo, federico.ercoles |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-no-loops
- Repository: https://github.com/buildo/eslint-plugin-no-loops
- Homepage: https://github.com/buildo/eslint-plugin-no-loops#readme
- Issues: https://github.com/buildo/eslint-plugin-no-loops/issues
- npm.io page: https://npm.io/package/eslint-plugin-no-loops

## Recent versions

- 0.4.0 (latest) — 2024-06-13
- 0.3.0 — 2016-06-24
- 0.2.0 — 2016-03-16
- 0.1.1 — 2016-01-21
- 0.1.0 — 2016-01-19

## README

# eslint-plugin-no-loops
It's 2024 and you still use loops?

[![Build Status](https://travis-ci.org/buildo/eslint-plugin-no-loops.svg?branch=master)](https://travis-ci.org/buildo/eslint-plugin-no-loops)
[![npm](https://img.shields.io/npm/v/eslint-plugin-no-loops.svg)](https://www.npmjs.com/package/eslint-plugin-no-loops)

<p align="center">
  <img src="https://i.imgflip.com/1oa3kd.jpg" title="made at imgflip.com"/> 
</p>

## Installation
```sh
npm install --save-dev eslint-plugin-no-loops
```

## Usage
In your `.eslintrc`:

```javascript
{
  "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](http://www.codereadability.com/coding-without-loops/) [need](http://joelhooks.com/blog/2014/02/06/stop-writing-for-loops-start-using-underscorejs/) [them](http://www.sitepoint.com/quick-tip-stop-writing-loops-start-thinking-with-maps/).

## 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!

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

 What is a rule without its exceptions?

---
_Source: https://npm.io/package/eslint-plugin-no-loops · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
