Skip to content

Latest commit

 

History

History
48 lines (32 loc) · 1.14 KB

File metadata and controls

48 lines (32 loc) · 1.14 KB

ember/template-no-yield-block-params-to-else-inverse

Yielding to else block is mainly useful for supporting curly invocation syntax. However, the else block in curly invocation syntax does not support consuming block params.

Yielding block params (positional arguments) to else or inverse blocks doesn't work as expected. The params are not available in the inverse block.

Examples

This rule forbids the following:

<template>
  {{yield 'some' 'param' to='else'}}
</template>
<template>
  {{yield 'some' 'param' to='inverse'}}
</template>

This rule allows the following:

<template>
  {{yield}}
  {{yield to='else'}}
  {{yield to='inverse'}}
</template>

Migration

We need to remove block params from highlighted yield's and update application logic to not consume it.

In addition, we could use named blocks (slots) to provide values.

References

Related Rules