diff --git a/packages/lint/src/context.ts b/packages/lint/src/context.ts index 7ee0d7516..3e71b29a3 100644 --- a/packages/lint/src/context.ts +++ b/packages/lint/src/context.ts @@ -34,8 +34,15 @@ export function buildLintContext(html: string, options: HyperframeLinterOptions // hijack the boundary match below. Linear + fixpoint (see stripHtmlComments) to // stay ReDoS-free and catch markers that re-form when a comment is removed. let source = stripHtmlComments(rawSource); + const sourceWithoutTemplates = source.replace( + /]*>[\s\S]*?<\/template(?:\s[^>]*)?>/gi, + " ", + ); const templateMatch = source.match(/]*>([\s\S]*)<\/template>/i); - if (templateMatch?.[1]) source = templateMatch[1]; + // Some sub-composition files are HTML shells whose real root lives inside a + //