Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 1.05 KB

File metadata and controls

46 lines (31 loc) · 1.05 KB

ember/template-no-unnecessary-component-helper

✅ The extends: 'plugin:ember/strict-gjs' and extends: 'plugin:ember/strict-gts' property in a configuration file enables this rule.

Disallow unnecessary usage of the {{component}} helper with static component names.

Rule Details

This rule disallows using {{component "component-name"}} when you could use angle bracket invocation instead.

Examples

Examples of incorrect code for this rule:

<template>
  {{component "my-component"}}
</template>

<template>
  {{component "MyComponent" arg="value"}}
</template>

Examples of correct code for this rule:

<template>
  <MyComponent />
</template>

<template>
  {{component this.dynamicComponentName}}
</template>

<template>
  {{component @componentName}}
</template>

References