-
Notifications
You must be signed in to change notification settings - Fork 63
Closed
Description
I am using this linter in a project and it raised an issue about code like this:
apples
.filter(apple => !apple.bad)
.forEach(doSomething)A for loop would have been messy in this context as the forEach had a number of const declarations. I ended up working around it by changing the forEach to map.
What is the motivation for this rule? My guess is that forEach doesn't play nicely with async functions, but I'm not sure. The current doc doesn't provide any explanation of the rationale: https://github.com/github/eslint-plugin-github/blob/master/docs/rules/array-foreach.md
cc @github/product-docs-engineering
cc @josh @koddsson @keithamus
Metadata
Metadata
Assignees
Labels
No labels