Skip to content

Fix rule: ember/template-no-unused-block-params#2636

Merged
NullVoxPopuli merged 4 commits intoember-cli:masterfrom
tcjr:unused-block-attr
Apr 4, 2026
Merged

Fix rule: ember/template-no-unused-block-params#2636
NullVoxPopuli merged 4 commits intoember-cli:masterfrom
tcjr:unused-block-attr

Conversation

@tcjr
Copy link
Copy Markdown
Contributor

@tcjr tcjr commented Apr 3, 2026

This PR updates the ember/template-no-unused-block-params to work correctly when the block param is used in attribute values.

For example, the following template is valid, but currently fails lint:

{{#each cats as |cat|}}
  <div class="cat {{cat.name}}"></div>
{{/each}}

With a scope of cats = [{ name: 'Stimpy' }], it produces this HTML:

<div class="cat Stimpy"></div>

Similarly, this template is valid:

{{#each cats as |cat|}}
  <div class="cat {{if (isFavorite cat.name favoriteCatNames) 'favorite'}}"></div>
{{/each}}

I've added 3 new valid template tests (2 of which fail without this fix), and 2 invalid template tests.

@tcjr tcjr changed the title Fix rule: no-unused-block-params Fix rule: ember/template-no-unused-block-params Apr 3, 2026
@NullVoxPopuli NullVoxPopuli merged commit 37b5777 into ember-cli:master Apr 4, 2026
12 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants