0.0.1 • Published 2 years ago

eslint-plugin-no-async-in-for-each-loop v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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) })