fix: Ignore findBy calls from ember-cli-mirage in no-array-prototype-extensions#2331
fix: Ignore findBy calls from ember-cli-mirage in no-array-prototype-extensions#2331bmish merged 4 commits intoember-cli:masterfrom VasylMarchuk:ignore-mirage-findby-calls
findBy calls from ember-cli-mirage in no-array-prototype-extensions#2331Conversation
| */ | ||
| const KNOWN_NON_ARRAY_FUNCTION_CALLS_REGEXP = new Set([ | ||
| // ember-cli-mirage | ||
| /(window|undefined)\.server\.schema\.(.*)\.findBy\(\)/, |
There was a problem hiding this comment.
Why is (window|undefined) part of it? That doesn't seem related to this example.
There was a problem hiding this comment.
That is how it comes up in eslint-plugin-ember's code that checks for exceptions (here in this file), as window.server... or undefined.server... even though in our tests we use this.server.... I am unsure why.
There was a problem hiding this comment.
I can change the regexp to just /\.server\.schema\.(.*)\.findBy\(\)/ if it seems more appropriate.
There was a problem hiding this comment.
It looks like window / undefined is some artifact of our getName helper that we could probably fix separately. Either way, it's not relevant to us, so let's avoid including it.
There was a problem hiding this comment.
Done, changed to simply /\.server\.schema\.(.*)\.findBy\(\)/
findBy calls from ember-cli-mirage in no-array-prototype-extensionsfindBy calls from ember-cli-mirage in no-array-prototype-extensions
We're trying to fix array prototype extensions usages in our project, and are running into a lot of false positives in our tests when using
findByfromember-cli-mirage:This adds an exception to
lib/rules/no-array-prototype-extensions.jsand adjusts the tests.