Skip to content

Post-merge-review: Fix template-require-has-block-helper: skip JS scope bindings#2673

Open
johanrd wants to merge 1 commit intoember-cli:masterfrom
johanrd:night_fix/template-require-has-block-helper
Open

Post-merge-review: Fix template-require-has-block-helper: skip JS scope bindings#2673
johanrd wants to merge 1 commit intoember-cli:masterfrom
johanrd:night_fix/template-require-has-block-helper

Conversation

@johanrd
Copy link
Copy Markdown
Contributor

@johanrd johanrd commented Apr 13, 2026

What's broken on master

Flags hasBlock/hasBlockParams and rewrites them to has-block/has-block-params (Glimmer keywords). In GJS/GTS, a user could import their own hasBlock — and the autofix would silently replace their reference with the built-in keyword, changing semantics.

Fix

Add JS scope check. Skip the report when the identifier resolves to a user binding.

Test plan

64/64 tests pass. 2 new GJS valid tests fail on master.


Co-written by Claude.

The rule rewrites hasBlock/hasBlockParams to has-block/has-block-params
(Glimmer keywords). In GJS/GTS, a user could legitimately import or
declare their own hasBlock binding, and the rule would incorrectly
rewrite their reference to the built-in keyword, changing semantics.
Add a JS scope check (walking scope.variables up the chain) and skip
the report when the identifier resolves to a user binding.
@johanrd johanrd marked this pull request as ready for review April 13, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant