0.7.0 • Published 1 year ago

eslint-plugin-no-loop v0.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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"]
            }
        ]
    }
}
0.7.0

1 year ago

0.6.0

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago

0.0.0

1 year ago