Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.03 KB

no-unused-block-params.md

File metadata and controls

49 lines (34 loc) · 1.03 KB

no-unused-block-params

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

This rule forbids unused block parameters except when they are needed to access a later parameter.

Examples

This rule forbids the following (unused parameters):

{{#each users as |user index|}}
  {{user.name}}
{{/each}}

This rule allows the following:

Allowed (used parameters):

{{#each users as |user|}}
  {{user.name}}
{{/each}}
{{#each users as |user index|}}
  {{index}} {{user.name}}
{{/each}}

Allowed (later parameter used):

{{#each users as |user index|}}
  {{index}}
{{/each}}

Related rules

References