💼 This rule is enabled in the 📋 template-lint-migration config.
🔧 This rule is automatically fixable by the --fix CLI option.
HBS Only: This rule applies to classic
.hbstemplate files only (loose mode). It is not relevant forgjs/gtsfiles (strict mode), where these patterns cannot occur.
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.
This rule forbids the following:
<template>
{{component "my-component"}}
</template>This rule allows the following:
<template>
{{component SOME_COMPONENT_NAME}}
</template><template>
{{!-- the `component` helper is needed to invoke this --}}
{{component "addon-name@component-name"}}
</template><template>
{{my-component}}
</template><template>
{{my-component close=(component "link-to" "index")}}
<MyComponent @close={{component "link-to" "index"}} />
</template>