Skip to content

Post-merge-review: Fix template-no-empty-headings: recognize <this.X>, <@x>, <ns.X> as accessible content#2663

Open
johanrd wants to merge 1 commit intoember-cli:masterfrom
johanrd:night_fix/template-no-empty-headings
Open

Post-merge-review: Fix template-no-empty-headings: recognize <this.X>, <@x>, <ns.X> as accessible content#2663
johanrd wants to merge 1 commit intoember-cli:masterfrom
johanrd:night_fix/template-no-empty-headings

Conversation

@johanrd
Copy link
Copy Markdown
Contributor

@johanrd johanrd commented Apr 13, 2026

What's broken on master

isComponent only considers PascalCase tags or Foo::Bar nested-component syntax. It misses three valid GTS component invocation forms per the template tag format guide:

  • <this.Heading> (class-scoped component reference)
  • <@heading> (argument-passed component)
  • <ns.Heading> (dot-path re-export)

When one of these appears as the only child of a heading, the rule walks the child list, fails to identify it as a component, and reports the heading as empty.

Fix

Extend isComponent with three additional conditions: tag.startsWith('this.'), tag.startsWith('@'), tag.includes('.'). All three are component forms that cannot be HTML elements in any mode (HTML doesn't allow this./@/. in tag names).

Test plan

  • 50/50 tests pass on the branch
  • 3 new valid tests (<h1><this.Heading />, <h2><@heading />, <h3><ns.Heading />) all fail on master

Co-written by Claude.

…ldren

GTS component invocations can appear as <this.Foo>, <@foo>, or <ns.Foo>
in addition to PascalCase. The rule's isComponent() check was too narrow,
so children of headings using these forms were not recognized as content
and the heading was falsely flagged as empty.
@johanrd johanrd marked this pull request as ready for review April 13, 2026 10:29
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