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
This commit is contained in:
Miguel Ángel
2026-03-30 18:29:47 +02:00
parent f3ae3e2dc8
commit 8bc99ebd9d
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -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,
};
}
+1
View File
@@ -15,6 +15,7 @@ export type HyperframeLintResult = {
ok: boolean;
errorCount: number;
warningCount: number;
infoCount: number;
findings: HyperframeLintFinding[];
};