fix(cli): the lint summary points at hyperframes lint, not a flag only render takes (#6723)

This commit is contained in:
Miguel Ángel
2026-10-29 06:44:01 +00:00
committed by GitHub
parent be05c86932
commit 98a28cc4b2
2 changed files with 12 additions and 5 deletions
+9 -2
View File
@@ -217,12 +217,19 @@ describe("formatLintStartupMessage", () => {
},
]);
it("collapses to a one-line summary by default, pointing at --lint-verbose (no Studio open)", () => {
it("collapses to a one-line summary by default, pointing at the lint command (no Studio open)", () => {
const lines = formatLintStartupMessage(result, { kind: "summary" });
expect(lines).toHaveLength(1);
expect(lines[0]).toContain("2 error(s), 1 warning(s)");
expect(lines[0]).not.toContain("Studio");
expect(lines[0]).toContain("--lint-verbose");
expect(lines[0]).toContain("hyperframes lint");
});
it("does not name --lint-verbose, a flag lint and check do not take", () => {
for (const pointer of [undefined, "studio"] as const) {
const lines = formatLintStartupMessage(result, { kind: "summary", pointer });
expect(lines[0]).not.toContain("--lint-verbose");
}
});
it("names the Studio badge and the lint command when pointer is 'studio'", () => {
+3 -3
View File
@@ -76,8 +76,8 @@ function formatLintCounts(
}
/** Full findings in verbose mode, a one-line summary otherwise. `pointer` (summary
* mode) picks the hint: "cli" names --lint-verbose, "studio" also names the lint
* command, since preview's stdout may be read by an agent. */
* mode) picks the hint: both name the lint command, "studio" also the Studio badge. --lint-verbose is
* not named: only render, preview and publish take it, and agents tried it on lint and check. */
export type LintMessageMode =
| { kind: "verbose"; options?: LintFormatOptions }
| { kind: "summary"; pointer?: "cli" | "studio" };
@@ -91,7 +91,7 @@ export function formatLintStartupMessage(
const hint =
mode.pointer === "studio"
? "see the Lint badge in Studio, or run `hyperframes lint` for full output"
: "run with --lint-verbose for full output";
: "run `hyperframes lint` for full output";
return [` Lint: ${counts} — ${hint}.`];
}