ember/route-path-style
October 22, 2024 ยท View on GitHub
๐ก This rule is manually fixable by editor suggestions.
Enforces usage of kebab-case (instead of snake_case or camelCase) in route paths.
A best practice on the web is to use kebab-case (hyphens) for separating words in URLs. This style is good for readability, clarity, SEO, etc.
Example kebab-case URL: https://guides.emberjs.com/release/getting-started/core-concepts/
Examples
Examples of incorrect code for this rule:
this.route('blog_posts');
this.route('blogPosts');
this.route('blog-posts', { path: '/blog_posts' });
this.route('blog-posts', { path: '/blogPosts' });
Examples of correct code for this rule:
this.route('blog-posts');
this.route('blog_posts', { path: '/blog-posts' });
References
- Ember Routing Guide
- Keep a simple URL structure article by Google