ember/no-shadow-route-definition

February 14, 2023 ยท View on GitHub

๐Ÿ’ผ This rule is enabled in the โœ… recommended config.

Enforce no route path definition shadowing in Router.

Rule Details

This rule disallows defining shadowing route definitions. Shadowing will result in the router failing to resolve the path of the shadowed route, leading to undesirable and incomprehensible behavior (e.g. hooks of the shadowed route not firing even though the URL matches its path).

Examples

Examples of incorrect code for this rule:

this.route('main', { path: '/' }, function () {
  this.route('nested');
});
this.route('nested');

In this example from Router perspective both nested routes are on URL /nested.