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

Fix some crashes including with legacy classes in no-deprecated-router-transition-methods and no-implicit-injections rules #1722

Merged

Conversation

rtablada
Copy link
Contributor

@rtablada rtablada commented Jan 2, 2023

When trying the latest version with updated rules, I found there were issues with the two deprecation rules when used with some more obscure legacy Ember object patterns.

I added tests that would fail on the main branch lib code and updated lib to suit.

Fixes #1728.

@rtablada rtablada marked this pull request as draft January 2, 2023 14:30
@rtablada
Copy link
Contributor Author

rtablada commented Jan 2, 2023

After configuring on another one of our projects I've found some more bugs.

Adding tests and working on them now

(serviceExpression.arguments.length > 0 &&
serviceExpression.arguments[0].value === 'router')
) {
if (serviceInjectImportName) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this if statement, if inject service wasn't imported: then any property would have been checked/considered as being a service.

@rtablada rtablada marked this pull request as ready for review January 2, 2023 15:43
@bmish bmish changed the title Fix error on Legacy Invocations Fix some crashes including with legacy classes in no-deprecated-router-transition-methods and no-implicit-injections rules Jan 3, 2023
Copy link
Member

@bmish bmish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bmish bmish merged commit 0365af2 into ember-cli:master Jan 3, 2023
@bmish bmish added the Bug label Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

no-deprecated-router-transition-methods blows up
2 participants