Skip to content

Commit

Permalink
no-fn-reference-in-iterator: Ignore this. and Vue.filter
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Apr 26, 2020
1 parent 47f2246 commit 0aab75e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/no-fn-reference-in-iterator.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ ruleTester.run('no-fn-reference-in-iterator', rule, {
...simpleMethods.map(method => `foo.${method}(element => fn(element))`),
...reduceLikeMethods.map(method => `foo.${method}((accumulator, element) => fn(element))`),

// `this.{map, filter, …}`
...simpleMethods.map(method => `this.${method}(fn)`),
...reduceLikeMethods.map(method => `this.${method}(fn)`),

// `Boolean`
...simpleMethods.map(method => `foo.${method}(Boolean)`),

Expand All @@ -83,7 +87,10 @@ ruleTester.run('no-fn-reference-in-iterator', rule, {
'_.map(fn)',
'Async.map(list, fn)',
'async.map(list, fn)',
'React.children.forEach(children, fn)'
'React.children.forEach(children, fn)',

'Vue.filter(name, fn)',

],
invalid: [
// Suggestions
Expand Down

0 comments on commit 0aab75e

Please sign in to comment.