eslint-plugin-no-async-in-for-each-loop

0.0.1 • Public • Published

eslint-plugin-no-async-in-for-each-loop

Disallow using async in forEach loops

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-no-async-in-for-each-loop:

npm install eslint-plugin-no-async-in-for-each-loop --save-dev

Usage

Add no-async-in-for-each-loop to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "no-async-in-for-each-loop"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "no-async-in-for-each-loop/no-async-in-for-each-loop": 2
    }
}

Examples

Valid code 👍:

['gunma'].forEach((prefecutre) => { console.log(prefecutre) })

Invalid code 👎:

['tokyo'].forEach(async (prefecutre) => { console.log(prefecture) })

Package Sidebar

Install

npm i eslint-plugin-no-async-in-for-each-loop

Weekly Downloads

2

Version

0.0.1

License

ISC

Unpacked Size

2.01 MB

Total Files

144

Last publish

Collaborators

  • tcassast