Skip to content

Commit 036e440

Browse files
Allow Children in no-fn-reference-in-iterator (#809)
Co-authored-by: Sindre Sorhus <[email protected]>
1 parent a314ca7 commit 036e440

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

rules/no-fn-reference-in-iterator.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const iteratorMethods = [
6060
const ignoredCallee = [
6161
'Promise',
6262
'React.children',
63+
'Children',
6364
'lodash',
6465
'underscore',
6566
'_',

test/no-fn-reference-in-iterator.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ ruleTester.run('no-fn-reference-in-iterator', rule, {
8888
'_.map(fn)',
8989
'Async.map(list, fn)',
9090
'async.map(list, fn)',
91-
'React.children.forEach(children, fn)',
91+
'React.Children.forEach(children, fn)',
92+
'Children.forEach(children, fn)', // `import {Children} from 'react';`
9293
'Vue.filter(name, fn)',
9394

9495
// First argument is not a function

0 commit comments

Comments
 (0)