-
-
Notifications
You must be signed in to change notification settings - Fork 211
Open
Description
I was quite excited to see #2331 get merged, as it would allow me to remove a lot of in-line disable comments of the no-array-prototype-extensions
rule in my mirage.js files. Unfortunately I've found a couple of cases of mirage findBy that aren't covered by that solution.
- if the call chain starts with
server
orschema
(common in mirage factories and config) and notthis.
orwindow.
, it's still flagged as a violation ofno-array-prototype-extensions
- e.g.
server.schema.users.findBy({email: '[email protected]'})
- e.g.
- it still requires both
server
andschema
in the request chain. When defining mocked routes inmirage.config.js
, onlyschema
is passed in, notserver
, so a query would beserver.modelName.findBy()
- e.g.
server.users.findBy({email: '[email protected]'})
- e.g.
- records can also be looked up in mirage via
server.db.modelName.findBy
, bypassingschema
. (though I'm not sure this is something to be encouraged).- e.g.
server.db.users.findBy({email: '[email protected]'})
- e.g.
Could the regex perhaps be tweaked not to require a preceeding .
, and only require that server
and/or schema
are in the request chain? or would that broaden the pattern too much?
Metadata
Metadata
Assignees
Labels
No labels