Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New rule: no-implicit-injections #1178

Closed
nelstrom opened this issue May 4, 2021 · 3 comments · Fixed by #1714
Closed

New rule: no-implicit-injections #1178

nelstrom opened this issue May 4, 2021 · 3 comments · Fixed by #1714
Labels
enhancement New Rule Idea for a new lint rule

Comments

@nelstrom
Copy link

nelstrom commented May 4, 2021

With the release of Ember 3.26:

Implicit injection has been deprecated. In particular, the store service from Ember Data must be explicitly injected into controllers and routes if they refer to this.store.

More details in the deprecation guide. We should add a rule that flags up implicit injections.

For the common case of using this.store, it should be pretty straightforward to implement a fixer too.

@nelstrom
Copy link
Author

nelstrom commented May 4, 2021

Note that #195 proposes a rule called no-implicit-injections, which sounds similar but the motivation behind it is based on recommended 'best practices', whereas this proposal is based on a deprecation.

@bmish
Copy link
Member

bmish commented May 5, 2021

Regarding rule naming:

I actually think we should name the rule from #195 no-implicit-service-injection-argument to be more specific about what that is referring to, and then we can name your rule no-implicit-injections to match how the deprecation describes it.

no-implicit-service-injection-argument would be the opposite of the existing rule no-unnecessary-service-injection-argument.

@bmish
Copy link
Member

bmish commented May 9, 2021

I opened a PR to implement no-implicit-service-injection-argument: #1188

@bmish bmish changed the title New rule: deprecate-implicit-injections New rule: no-implicit-injections May 30, 2021
@lin-ll lin-ll closed this as completed Sep 30, 2021
@lin-ll lin-ll reopened this Sep 30, 2021
@bmish bmish added the New Rule Idea for a new lint rule label May 16, 2022
bmish pushed a commit that referenced this issue Dec 30, 2022
Co-authored-by: Bryan Mishkin <[email protected]>
Fixes #1178
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New Rule Idea for a new lint rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants