Skip to content

Latest commit

 

History

History
66 lines (46 loc) · 1.49 KB

File metadata and controls

66 lines (46 loc) · 1.49 KB

ember/template-no-dynamic-subexpression-invocations

💼 This rule is enabled in the following configs: strict-gjs, strict-gts.

💼 This rule is enabled in the following configs: strict-gjs, strict-gts.

Disallow dynamic helper invocations.

Dynamic helper invocations (where the helper name comes from a property or argument) make code harder to understand and can have performance implications. Use explicit helper names instead.

Rule Details

This rule disallows invoking helpers dynamically using this or @ properties.

Examples

Incorrect ❌

<template>
  {{(this.helper "arg")}}
</template>
<template>
  {{(@helperName "value")}}
</template>
<template>
  {{this.formatter this.data}}
</template>

Correct ✅

<template>
  {{format-date this.date}}
</template>
<template>
  {{(upper-case this.name)}}
</template>
<template>
  {{this.formattedData}}
</template>

Related Rules

References