You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some lint rules, doing import { service } from '@ember/service'; is not detected the same as import { inject as service } from '@ember/service'; when determining if a service is in use.
For example, in order-in-routes, foo: service() has a different expected position whether or not inject as service was detected at the top of the file. Similarly, require-computed-property-dependencies treats services as a missing dependency if you used import { service }, but not if you used import { inject as service }.
The various linting rules that have handling for services need to be evaluated for this use-case to handle the new best practice around service imports.
The text was updated successfully, but these errors were encountered:
elwayman02
changed the title
service decorator import not treated the same as "inject as service"
"service" import not treated the same as "inject as service"
Dec 14, 2023
I think this is related to how many rules started out just looking for service() instead of actually checking the name it was imported. I fixed a lot rules (#590) but not all.
In some lint rules, doing
import { service } from '@ember/service';
is not detected the same asimport { inject as service } from '@ember/service';
when determining if a service is in use.For example, in
order-in-routes
,foo: service()
has a different expected position whether or notinject as service
was detected at the top of the file. Similarly,require-computed-property-dependencies
treats services as a missing dependency if you usedimport { service }
, but not if you usedimport { inject as service }
.The various linting rules that have handling for services need to be evaluated for this use-case to handle the new best practice around service imports.
https://api.emberjs.com/ember/5.4/functions/@ember%2Fservice/service
The text was updated successfully, but these errors were encountered: