Skip to content

Fix crash with dynamic/variable route name in no-shadow-route-definition rule #1115

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

Merged

Conversation

bmish
Copy link
Member

@bmish bmish commented Mar 22, 2021

Fixes #1107.

@bmish bmish added the bug label Mar 22, 2021
@bmish
Copy link
Member Author

bmish commented Mar 22, 2021

@raido does this fix look good?

@bmish bmish merged commit 928cb70 into ember-cli:master Mar 22, 2021
@raido
Copy link
Contributor

raido commented Mar 23, 2021

@bmish 👍

@artursmirnov
Copy link

@bmish thank you for fixing the issue so quickly! Although, it fixes the issue only partly. It works perfectly for the cases mentioned in the tests (this.route(someVariable) and this.route('route', { path: someVariable }), but still errors when such route has nested ones, even static. For instance:

this.route(someVariable, function () {
  this.route('route');
});

In this case ESLint breaks with the same error but on the this.route('route'); line – looks like it tries to compose the full route path for it and fails on variable segment higher in the hierarchy.

Could you please take another look at it when you have a chance? Thank you so much in advance!

@bmish
Copy link
Member Author

bmish commented Apr 5, 2021

@artursmirnov thanks for reporting, I reopened the issue.

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.

Error while parsing dynamic route map in no-shadow-route-definition rule
3 participants