Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 1.22 KB

no-link-to-positional-params.md

File metadata and controls

59 lines (43 loc) · 1.22 KB

no-link-to-positional-params

✅ The extends: 'recommended' property in a configuration file enables this rule.

Disallows passing positional parameters into link-to in favor of named arguments.

Examples

This rule forbids the following:

{{link-to "About Us" "about"}}
{{#link-to "about"}}About Us{{/link-to}}
{{#link-to "post" @post}}Read {{@post.title}}...{{/link-to}}
{{#link-to "post.comment" @comment.post @comment}}
  Comment by {{@comment.author.name}} on {{@comment.date}}
{{/link-to}}
{{#link-to "posts" (query-params direction="desc" showArchived=false)}}
  Recent Posts
{{/link-to}}

This rule allows the following:

<LinkTo @route="about">About Us</LinkTo>
<LinkTo @route="post" @model={{@post}}>Read {{@post.title}}...</LinkTo>
<LinkTo @route="post.comment" @models={{array post comment}}>
  Comment by {{comment.author.name}} on {{comment.date}}
</LinkTo>
<LinkTo @route="posts" @query={{hash direction="desc" showArchived=false}}>
  Recent Posts
</LinkTo>

References

  • More information is available in RFC-0698