Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 1.22 KB

no-unnecessary-component-helper.md

File metadata and controls

40 lines (27 loc) · 1.22 KB

no-unnecessary-component-helper

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

🔧 The --fix option on the command line can automatically fix some of the problems reported by 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