diff --git a/src/linter/html/linter.ts b/src/linter/html/linter.ts index 55fcb2263..c402c301c 100644 --- a/src/linter/html/linter.ts +++ b/src/linter/html/linter.ts @@ -12,13 +12,12 @@ export async function lintHtml(resourceName: string, contentStream: ReadStream): const jsScriptTags = await extractJSScriptTags(contentStream); jsScriptTags.forEach((tag) => { - const scriptContent = tag.textNodes?.map((tNode) => tNode.value).join(""); // Tags with src attribute do not parse and run inline code const hasSrc = tag.attributes.some((attr) => { return attr.name.value.toLowerCase() === "src"; }); - if (!hasSrc && scriptContent) { + if (!hasSrc && tag.textNodes?.length > 0) { report.addMessage({ node: tag, severity: LintMessageSeverity.Warning,