Skip to content

Latest commit

 

History

History
69 lines (48 loc) · 1.93 KB

File metadata and controls

69 lines (48 loc) · 1.93 KB

ember/template-require-has-block-helper

💼 This rule is enabled in the 📋 template-lint-migration config.

🔧 This rule is automatically fixable by the --fix CLI option.

In Ember 3.26 the properties hasBlock and hasBlockParams were deprecated. Their replacement is to use has-block and has-block-params helpers instead.

This rule prevents the usage of hasBlock and hasBlockParams and suggests using has-block or has-block-params instead.

For more information about this deprecation you can view the RFC or its entry on the Deprecations page.

Examples

This rule forbids the following:

<template>
  {{hasBlock}}
  {{#if hasBlock}}

  {{/if}}
</template>
<template>
  {{hasBlockParams}}
  {{#if hasBlockParams}}

  {{/if}}
</template>

This rule allows the following:

<template>
  {{has-block}}
  {{#if (has-block)}}

  {{/if}}
</template>
<template>
  {{has-block-params}}
  {{#if (has-block-params)}}

  {{/if}}
</template>

Migration

  • {{hasBlock}} -> {{has-block}}
  • {{hasBlockParams}} -> {{has-block-params}}
  • {{#if hasBlock}} {{/if}} -> {{#if (has-block)}} {{/if}}
  • {{#if (hasBlock "inverse")}} {{/if}} -> {{#if (has-block "inverse")}} {{/if}}
  • {{#if hasBlockParams}} {{/if}} -> {{#if (has-block-params)}} {{/if}}
  • {{#if (hasBlockParams "inverse")}} {{/if}} -> {{#if (has-block-params "inverse")}} {{/if}}

References