No async callback for Array methods forEach, map, filter, reduce, some, every, etc.
$ npm i eslint-plugin-no-async-array-methods --save-dev
$ yarn add -D eslint-plugin-no-async-array-methods
Note: You have to install eslint-plugin-no-async-array-methods
globally (using the -g
flag) if you installed ESLint globally.
In your .eslintrc
configuration file, add no-async-array-methods
to the plugins section.
{
"plugins": [
"no-async-array-methods"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"no-async-array-methods/no-async-array-methods": 2
}
}
-
"no-async-array-methods/no-async-array-methods"
- Bans async
forEach, filter, some, every, find, findIndex, map, reduce
- Bans async
-
"no-async-array-methods/all"
- (same as above)
-
"no-async-array-methods/defaults"
- Bans async
forEach, filter, some, every, find, findIndex
- Bans async
-
"no-async-array-methods/map-reduce"
- Bans async
map, reduce
- Bans async