Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 1.03 KB

File metadata and controls

53 lines (39 loc) · 1.03 KB

ember/template-require-has-block-helper

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

Requires usage of the (has-block) helper instead of the hasBlock property.

Rule Details

The (has-block) helper is the preferred way to check if a block was provided to a component.

Examples

Examples of incorrect code for this rule:

<template>
  {{#if hasBlock}}
    {{yield}}
  {{/if}}
</template>
<template>
  {{#if this.hasBlock}}
    {{yield}}
  {{/if}}
</template>

Examples of correct code for this rule:

<template>
  {{#if (has-block)}}
    {{yield}}
  {{/if}}
</template>
<template>
  {{#if (has-block "inverse")}}
    {{yield to="inverse"}}
  {{/if}}
</template>

References