ember-cli / ember-cli/eslint-plugin-ember

should any form of transition be an error if occurring from the application route

Open
#1,540 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
263
Forks
214
Avg merge
30m
Merged PRs (30d)
5

Description

Originally reported here: https://github.com/emberjs/rfcs/issues/759

I ran in to this while debugging: https://github.com/mariogintili/async-model/pull/1/files#diff-be9bc2296e644e9cc4c783e51a6a231716c251353aca253effd68264bae589fbR5

what I wrote there:
```
// routes/application.js
* This model hook is ran for _every_ route. Because routes are a hierarchy.
* But because it would be verbose to say 'application.foo', application is
* omitted from all route names (dot notation).
*
* So, we _cannot_ transition away from the application route. I believe this
* should probably throw an error when transitionTo is called at all from the
* application route.
*
* Instead, what we want to do is transition away *only* if we are not on a sub-route.
* Like, application.index.
```

Implementation wise, I don't know if it's possible to know which Route file the transition is called from. _but_, we could address this with a lint. What do folks think?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.