From d649ad3dc584565acb4af24275743641d086e169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Sun, 29 Mar 2026 11:02:50 +0000 Subject: [PATCH] fix(core): separate info count from warning count in linter results The linter was computing warningCount as findings.length - errorCount, which lumped info-severity findings into the warning count. Now counts warnings and infos separately, and adds a new infoCount field. Reproducer: # Create composition with timed element missing class="clip" npx hyperframes lint # Was: "0 errors, 1 warning(s)" npx hyperframes lint --json # Was: severity: "info" but warningCount: 1 # Now warningCount: 0, infoCount: 1 --- packages/core/src/lint/hyperframeLinter.ts | 4 +++- packages/core/src/lint/types.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/src/lint/hyperframeLinter.ts b/packages/core/src/lint/hyperframeLinter.ts index 57bf8ce27..9d6939ad8 100644 --- a/packages/core/src/lint/hyperframeLinter.ts +++ b/packages/core/src/lint/hyperframeLinter.ts @@ -636,12 +636,14 @@ export function lintHyperframeHtml( } const errorCount = findings.filter((finding) => finding.severity === "error").length; - const warningCount = findings.length - errorCount; + const warningCount = findings.filter((finding) => finding.severity === "warning").length; + const infoCount = findings.filter((finding) => finding.severity === "info").length; return { ok: errorCount === 0, errorCount, warningCount, + infoCount, findings, }; } diff --git a/packages/core/src/lint/types.ts b/packages/core/src/lint/types.ts index 30f85fbb9..075919c15 100644 --- a/packages/core/src/lint/types.ts +++ b/packages/core/src/lint/types.ts @@ -15,6 +15,7 @@ export type HyperframeLintResult = { ok: boolean; errorCount: number; warningCount: number; + infoCount: number; findings: HyperframeLintFinding[]; };