From 5f22209a82afbdf3c2a8d1a788b94e9aeeaac689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Fri, 10 Jul 2026 22:57:29 -0400 Subject: [PATCH] fix(cli): correct strict warning hint (#2221) --- packages/cli/src/commands/render.test.ts | 11 +++++++++++ packages/cli/src/commands/render.ts | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/render.test.ts b/packages/cli/src/commands/render.test.ts index e80ea824c..8cda99fff 100644 --- a/packages/cli/src/commands/render.test.ts +++ b/packages/cli/src/commands/render.test.ts @@ -130,16 +130,27 @@ describe("renderLocal browser GPU config", () => { // suites). Importing once in `beforeAll` keeps every test fast and isolated. let renderLocal: typeof import("./render.js").renderLocal; let resolveBrowserGpuForCli: typeof import("./render.js").resolveBrowserGpuForCli; + let renderLintContinuationHint: typeof import("./render.js").renderLintContinuationHint; let resetTrialState: typeof import("./render.js").__resetDeParallelRouterTrialStateForTests; beforeAll(async () => { ({ renderLocal, resolveBrowserGpuForCli, + renderLintContinuationHint, __resetDeParallelRouterTrialStateForTests: resetTrialState, } = await import("./render.js")); }); + it("points strict warning-only renders to --strict-all", () => { + expect(renderLintContinuationHint(true)).toContain("--strict-all"); + expect(renderLintContinuationHint(true)).not.toContain("Use --strict to block"); + }); + + it("points non-strict renders to --strict for lint errors", () => { + expect(renderLintContinuationHint(false)).toContain("Use --strict to block errors"); + }); + function setEnv(key: string, value: string) { if (!savedEnv.has(key)) savedEnv.set(key, process.env[key]); process.env[key] = value; diff --git a/packages/cli/src/commands/render.ts b/packages/cli/src/commands/render.ts index 0d91b2cc1..37717cc42 100644 --- a/packages/cli/src/commands/render.ts +++ b/packages/cli/src/commands/render.ts @@ -825,7 +825,7 @@ export default defineCommand({ console.log(""); process.exit(1); } - console.log(c.dim(" Continuing render despite lint issues. Use --strict to block.")); + console.log(c.dim(renderLintContinuationHint(strictErrors))); console.log(""); } } @@ -1004,6 +1004,12 @@ export interface SingleRenderResult { renderTimeMs: number; } +export function renderLintContinuationHint(strictErrors: boolean): string { + return strictErrors + ? " Continuing render despite lint warnings. Use --strict-all to block warnings." + : " Continuing render despite lint issues. Use --strict to block errors."; +} + interface RenderOptions { fps: Fps; quality: "draft" | "standard" | "high";