Skip to content

Commit

Permalink
no-array-for-each: Ignore pIteration.forEach (#1649)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Dec 21, 2021
1 parent 1ff8e42 commit 2b92385
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rules/no-array-for-each.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ const ignoredObjects = [
'React.Children',
'Children',
'R',
// https://www.npmjs.com/package/p-iteration
'pIteration',
];

/** @param {import('eslint').Rule.RuleContext} context */
Expand Down
6 changes: 6 additions & 0 deletions test/no-array-for-each.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ test.snapshot({
// #1087
'React.Children.forEach(children, (child) => {});',
'Children.forEach(children, (child) => {});',
// #1508
outdent`
await pIteration.forEach(plugins, async pluginName => {
// My other code...
});
`,
],
invalid: [
// Not fixable
Expand Down

0 comments on commit 2b92385

Please sign in to comment.