From 130773de66b69d115b2448d0795302aabf3dd7e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20R=C3=B8ed?= Date: Sun, 12 Apr 2026 22:01:07 +0200 Subject: [PATCH] Fix template-no-empty-headings: detect this./@/dot-path component children GTS component invocations can appear as , <@foo>, or 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. --- lib/rules/template-no-empty-headings.js | 10 +++++++++- tests/lib/rules/template-no-empty-headings.js | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/rules/template-no-empty-headings.js b/lib/rules/template-no-empty-headings.js index 8443e3f198..e3a516eccb 100644 --- a/lib/rules/template-no-empty-headings.js +++ b/lib/rules/template-no-empty-headings.js @@ -19,7 +19,15 @@ function isComponent(node) { return false; } const tag = node.tag; - return /^[A-Z]/.test(tag) || tag.includes('::'); + // PascalCase (), namespaced (), this.-prefixed + // (), arg-prefixed (<@component>), or dot-path () + return ( + /^[A-Z]/.test(tag) || + tag.includes('::') || + tag.startsWith('this.') || + tag.startsWith('@') || + tag.includes('.') + ); } function isTextEmpty(text) { diff --git a/tests/lib/rules/template-no-empty-headings.js b/tests/lib/rules/template-no-empty-headings.js index 4d1a911fb4..cce6b806da 100644 --- a/tests/lib/rules/template-no-empty-headings.js +++ b/tests/lib/rules/template-no-empty-headings.js @@ -38,6 +38,11 @@ ruleTester.run('template-no-empty-headings', rule, { '', '', '', + + // Non-PascalCase component forms count as accessible content + '', + '', + '', ], invalid: [ {