mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 04:38:33 +00:00
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:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ export type HyperframeLintResult = {
|
||||
ok: boolean;
|
||||
errorCount: number;
|
||||
warningCount: number;
|
||||
infoCount: number;
|
||||
findings: HyperframeLintFinding[];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user