Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 1.04 KB

File metadata and controls

53 lines (39 loc) · 1.04 KB

ember/template-no-yield-to-default

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

The yield keyword can be used for invoking blocks passed into a component. The to named argument specifies which of the blocks to yield too. Specifying {{yield to="default"}} is unnecessary, as that is the default behavior. Likewise, {{has-block}} and {{has-block-params}} also defaults to checking the "default" block.

This rule disallow yield to named blocks with the name "default".

Examples

This rule forbids the following:

<template>
  {{yield to="default"}}
</template>
<template>
  {{has-block "default"}}
</template>
<template>
  {{has-block-params "default"}}
</template>

This rule allows the following:

<template>
  {{yield}}
</template>
<template>
  {{has-block}}
</template>
<template>
  {{has-block-params}}
</template>

References