no-trailing-dot-in-path-expression.md
January 12, 2019 ยท View on GitHub
no-trailing-dot-in-path-expression
This rule doesn't allow trailing dot(s) on a path expression. Since the trailing dot is treated as a separate path expression which represents the context associated to the template.
For instance:
{{! application.hbs }}
<span class={{if contact. 'bg-success'}}>{{contact.name}}</span>
is interpreted as
{{! application.hbs }}
<span class={{if contact . 'bg-success'}}>{{contact.name}}</span>
hence results in
<span class="<my-app@controller:application::ember223>">John</span>
This rule forbids the following:
{{contact.contact_name.}}
{{#if contact.contact_name.}}
{{displayName}}
{{/if}}
{{if. contact.contact_name}}
{{displayName}}
{{/if}}
{{contact-details contact=(hash. name=name. age=age)}}
This rule allows the following:
{{contact.contact_name}}
{{#if contact.contact_name}}
{{displayName}}
{{/if}}
{{if contact.contact_name}}
{{displayName}}
{{/if}}
{{contact-details contact=(hash name=name age=age)}}