Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 1.67 KB

require-has-block-helper.md

File metadata and controls

59 lines (39 loc) · 1.67 KB

require-has-block-helper

✅ The extends: 'recommended' property in a configuration file enables this rule.

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

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

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