Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.12 KB

no-unnecessary-component-helper.md

File metadata and controls

38 lines (26 loc) · 1.12 KB

no-unnecessary-component-helper

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

The component template helper can be used to dynamically pick the component being rendered based on the provided property. But if the component name is passed as a string because it's already known, then the component should be invoked directly, instead of using the component helper.

Examples

This rule forbids the following:

{{component "my-component"}}

This rule allows the following:

{{component SOME_COMPONENT_NAME}}
{{!-- the `component` helper is needed to invoke this  --}}
{{component "addon-name@component-name"}}
{{my-component}}
{{my-component close=(component "link-to" "index")}}
<MyComponent @close={{component "link-to" "index"}} />

References