ember/template-no-unnecessary-component-helper

August 17, 2026 ยท View on GitHub

๐Ÿ’ผ This rule is enabled in the ๐Ÿ“‹ template-lint-migration config.

๐Ÿ”ง This rule is automatically fixable by the --fix CLI option.

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:

<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>

References