0.7.0 • Published 1 year ago
eslint-plugin-no-loop v0.7.0
eslint-plugin-no-loop
This plugin disallow the usage of for
, forOf
, forIn
, forEach
, while
and doWhile
loops.
Installation
npm i --save-dev eslint-plugin-no-loop
Usage
// Flat config (eslint >=v8)
import noLoopPlugin from "eslint-plugin-no-loop"
{
plugins: {
"no-loop": noLoopPlugin
},
rules: {
"no-loop/no-loop": ["error"]
}
}
// Old config
{
plugins: ["no-loop"],
rules: {
"no-loop/no-loop": ["error"]
}
}
Options
You can allow the use of certain loops :
{
rules: {
"no-loop/no-loop": [
"error", {
exceptions: ["for", "forOf", "forIn", "forEach", "while", "doWhile"]
}
]
}
}