From 87312d22482750160bfa2f82ea2217a5ff7f4ee2 Mon Sep 17 00:00:00 2001 From: uncenter Date: Tue, 9 Sep 2025 09:48:26 -0500 Subject: [PATCH] feat(scripts/lint): provide lint fix tip with failed lint run (#1901) --- scripts/lint/main.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/lint/main.ts b/scripts/lint/main.ts index 58edf2c9..67e2a250 100755 --- a/scripts/lint/main.ts +++ b/scripts/lint/main.ts @@ -2,6 +2,7 @@ import { REPO_ROOT } from "@/constants.ts"; import { parseArgs } from "@std/cli"; import * as path from "@std/path"; +import * as color from "@std/fmt/colors"; // @ts-types="npm:@types/less"; import less from "less"; @@ -64,4 +65,16 @@ for (const style of stylesheets) { if (await checkForMissingFiles() === false) didLintFail = true; // Cause the workflow to fail if any issues were found. -if (didLintFail || log.failed) Deno.exit(1); + +const THIN_SPACE = "\u2009"; + +if (didLintFail || log.failed) { + if (!args.fix) { + console.log( + `\n ${ + color.bold(color.inverse(color.green(`${THIN_SPACE}TIP${THIN_SPACE}`))) + } Run ${color.bold("deno task lint:fix")} to fix autofixable issues.`, + ); + } + Deno.exit(1); +}