Skip to content

Latest commit

 

History

History
56 lines (38 loc) · 1.59 KB

File metadata and controls

56 lines (38 loc) · 1.59 KB

require-has-block-helper

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:

{{hasBlock}}
{{#if hasBlock}}

{{/if}}
{{hasBlockParams}}
{{#if hasBlockParams}}

{{/if}}

This rule allows the following:

{{has-block}}
{{#if (has-block)}}

{{/if}}
{{has-block-params}}
{{#if (has-block-params)}}

{{/if}}

Migration

🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

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