Skip to content

Fix template-no-block-params-for-html-elements: align HTML-element detection#2689

Open
johanrd wants to merge 1 commit intoember-cli:masterfrom
johanrd:day_fix/template-no-block-params-for-html-elements
Open

Fix template-no-block-params-for-html-elements: align HTML-element detection#2689
johanrd wants to merge 1 commit intoember-cli:masterfrom
johanrd:day_fix/template-no-block-params-for-html-elements

Conversation

@johanrd
Copy link
Copy Markdown
Contributor

@johanrd johanrd commented Apr 13, 2026

Summary

  • Replaces static html-tags package check with inverse-of-isAngleBracketComponent logic (mirrors upstream)
  • Custom elements with a dash (<my-element as |x|>) no longer false-positively flagged

Why not just extend html-tags?

HTML is an open namespace — the browser parses any unknown lowercase tag as an HTMLUnknownElement (still HTML, still doesn't accept block params). The old allowlist-based check missed this class of false negative: <foo as |x|>{{x}}</foo> wasn't flagged because foo isn't in html-tags, but it should be. Extending the list (SVG, MathML, obsolete, etc.) only moves the gap — you'd end up enumerating "any lowercase identifier." Flipping the question to "is this not a component invocation?" is bounded (uppercase / . / @ / - / :) and matches upstream's long-standing approach.

Test plan

  • `<my-element as |x|>{{x}}` → valid
  • `<NS.Foo as |x|>{{x}}</NS.Foo>` → valid
  • `<div as |x|>` → still flagged

…tection with upstream

Replace static htmlTags package check with inverse-of-component-detection
(reject tags with : / . / uppercase / @ / -). Custom elements like
<my-element as |x|> are no longer false-flagged.
@johanrd johanrd marked this pull request as ready for review April 13, 2026 16:10
@johanrd johanrd force-pushed the day_fix/template-no-block-params-for-html-elements branch from a6eaaf3 to f6dcffa Compare April 13, 2026 17:38
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