Skip to content

Commit

Permalink
no-array-callback-reference: Ignore mobx-state-tree usage (#1455)
Browse files Browse the repository at this point in the history
  • Loading branch information
pustovalov authored Jul 28, 2021
1 parent 343824f commit 73c0dfd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rules/no-array-callback-reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ const iteratorMethods = [
returnsUndefined: true,
},
],
['map'],
[
'map', {
extraSelector: '[callee.object.name!="types"]',
},
],
[
'reduce', {
parameters: [
Expand Down
7 changes: 7 additions & 0 deletions test/no-array-callback-reference.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ test({
.limit(params.limit + 1)
.toArray()
`,

// #1455 - mobx-state-tree
outdent`
const EventsStore = types.model('EventsStore', {
events: types.optional(types.map(Event), {}),
})
`,
],
invalid: [
// Suggestions
Expand Down

0 comments on commit 73c0dfd

Please sign in to comment.