Skip to content

Latest commit

 

History

History
24 lines (15 loc) · 812 Bytes

no-shadow-route-definition.md

File metadata and controls

24 lines (15 loc) · 812 Bytes

ember/no-shadow-route-definition

💼 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.