Skip to content

Commit 5fddf2b

Browse files
committed
Document why manual block-param tracking is used instead of scope manager
1 parent 029c2c0 commit 5fddf2b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/rules/template-no-obsolete-elements.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,19 @@ module.exports = {
5050
},
5151
create(context) {
5252
const obsolete = new Set(OBSOLETE);
53+
54+
// Manual block-param tracking is intentional here. The ESLint scope manager
55+
// cannot be used as a drop-in replacement because:
56+
//
57+
// 1. In GJS/GTS, an element's own `as |x|` block params are already
58+
// visible in the scope at the element node itself, so getScope(node) on
59+
// `<marquee as |marquee|>` would incorrectly skip flagging it.
60+
//
61+
// 2. In HBS mode the scope manager only creates a minimal top-level scope;
62+
// block params from `{{#let ... as |x|}}` are not registered, so
63+
// getScope would not see them at all.
64+
//
65+
// The push/pop approach handles both edge cases correctly.
5366
const blockParamsInScope = [];
5467

5568
return {

0 commit comments

Comments
 (0)