Open elwayman02 opened 11 months ago
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 (https://github.com/ember-cli/eslint-plugin-ember/issues/590) but not all.
This import { service } from '@ember/service';
works for me; there is a need for more context on this issue
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