0.4.0 • Published 1 year ago

eslint-plugin-no-loops v0.4.0

Weekly downloads
12,610
License
MIT
Repository
github
Last release
1 year ago

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?

eslint-config-slick@tribecamp/eslinteslint-config-react-cdiba@dnb-org/eslint-config@typhoon41/eslint-vue-config@infinitebrahmanuniverse/nolb-eslint-plugin-n@everything-registry/sub-chunk-1613@benestudioco/eslint-config-benestudiojs-lints@anolilab/eslint-config@atlauncher/atlauncher-scripts@adobe-apimesh/mesh-builder@beecode/msh-config@actinc/eslint-config@actinc/eslint-plugin@bosscard/eslint-config@forter/eslint-config@hug/eslint-config@flexbe/eslint-config@kudobuzz/kbscripts@ishtar-gate/eslint-config-custom@newsteam/brick@enigmatry/eslint-config@encoura/eslint-config@max-norin/ts-project-init@megabytelabs/eslint-config@joncursi/eslint-config@qlean/eslint-config@qlean/eslint-config-react-native@numso/eslint-config-numso@slick_kilmister/node-dev-config@smartangels/eslint-config@sogody/experiment-framework@sogody/template-framework@sotream/eslint-config-nestjs@stae/linters@revved/eslint-config-node@revved/eslint-config-reactpatchedreact-miha-prettier-eslint@washingtondc/eslint@wttsolutions/eslint-config@twoday/eslint-config-super-template@testmeshbuilder/mesh-builder@tribecamp/eslint-config-base@visma/eslint-config-super-template@sweetlikepete/eslinteslint-config-meienbergereslint-config-meienberger-react-native-typescripteslint-config-meienberger-react-typescripteslint-config-react-exhaustiveeslint-config-yaruseslint-config-flexbeeslint-config-backendeslint-config-buildoeslint-config-digital-scientists-baseeslint-config-deepcrawleslint-config-evil-vueeslint-config-evil-vue-tseslint-config-modaeslint-config-mission-madeeslint-config-lottery
0.4.0

1 year ago

0.0.0

8 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago