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: [ {