Skip to content

Commit 655b695

Browse files
committed
feat(lint): provide lint fix tip with failed lint run
1 parent 14aa17b commit 655b695

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

scripts/lint/main.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { REPO_ROOT } from "@/constants.ts";
22

33
import { parseArgs } from "@std/cli";
44
import * as path from "@std/path";
5+
import * as color from "@std/fmt/colors";
56
// @ts-types="npm:@types/less";
67
import less from "less";
78

@@ -64,4 +65,16 @@ for (const style of stylesheets) {
6465
if (await checkForMissingFiles() === false) didLintFail = true;
6566

6667
// Cause the workflow to fail if any issues were found.
67-
if (didLintFail || log.failed) Deno.exit(1);
68+
69+
const THIN_SPACE = "\u2009";
70+
71+
if (didLintFail || log.failed) {
72+
if (!args.fix) {
73+
console.log(
74+
`\n ${
75+
color.bold(color.inverse(color.green(`${THIN_SPACE}TIP${THIN_SPACE}`)))
76+
}: Run ${color.bold("deno task lint:fix")} to fix autofixable issues.`,
77+
);
78+
}
79+
Deno.exit(1);
80+
}

0 commit comments

Comments
 (0)