From b08fbc784e3b4d6f96da17b1671de56cb8c7933f Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Wed, 7 Aug 2024 08:59:50 -0400 Subject: [PATCH] fix(lint): fail check if any log errors (#1173) --- scripts/lint/logger.ts | 7 +++++-- scripts/lint/main.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/lint/logger.ts b/scripts/lint/logger.ts index f8295ce4..872642eb 100644 --- a/scripts/lint/logger.ts +++ b/scripts/lint/logger.ts @@ -66,11 +66,14 @@ const prettyPrint = ( }; export const log = { - log: ( + failed: false, + + log: function ( message: string, props: LoggerProps, severity: "error" | "warning", - ) => { + ) { + if (severity === "error") this.failed = true; if (Deno.env.has("CI")) { switch (severity) { case "error": diff --git a/scripts/lint/main.ts b/scripts/lint/main.ts index d9f691b5..e2ac391b 100755 --- a/scripts/lint/main.ts +++ b/scripts/lint/main.ts @@ -65,4 +65,4 @@ for await (const entry of stylesheets) { if (await checkForMissingFiles() === false) failed = true; // Cause the workflow to fail if any issues were found. -if (failed) Deno.exit(1); +if (failed || log.failed) Deno.exit(1);