From 812e493ef53c6455faf1876461d5b091947845a1 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 12 Apr 2026 05:39:34 +0100 Subject: [PATCH] fix(lint): skip heavy-check lock for extra metadata commands --- scripts/lib/local-heavy-check-runtime.mjs | 20 +++++++++++++++++-- .../scripts/local-heavy-check-runtime.test.ts | 4 ++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/scripts/lib/local-heavy-check-runtime.mjs b/scripts/lib/local-heavy-check-runtime.mjs index 4b9a85bae80..74d68229059 100644 --- a/scripts/lib/local-heavy-check-runtime.mjs +++ b/scripts/lib/local-heavy-check-runtime.mjs @@ -92,7 +92,18 @@ export function shouldAcquireLocalHeavyCheckLockForOxlint( return true; } - if (args.some((arg) => arg === "--help" || arg === "-h" || arg === "--version" || arg === "-V")) { + if ( + args.some( + (arg) => + arg === "--help" || + arg === "-h" || + arg === "--version" || + arg === "-V" || + arg === "--rules" || + arg === "--print-config" || + arg === "--init", + ) + ) { return false; } @@ -125,7 +136,12 @@ export function shouldAcquireLocalHeavyCheckLockForTsgo(args, env = process.env) return !args.some( (arg) => - arg === "--help" || arg === "-h" || arg === "--version" || arg === "-v" || arg === "--init", + arg === "--help" || + arg === "-h" || + arg === "--version" || + arg === "-v" || + arg === "--init" || + arg === "--showConfig", ); } diff --git a/test/scripts/local-heavy-check-runtime.test.ts b/test/scripts/local-heavy-check-runtime.test.ts index ffaa043cd64..4905211cd2d 100644 --- a/test/scripts/local-heavy-check-runtime.test.ts +++ b/test/scripts/local-heavy-check-runtime.test.ts @@ -181,6 +181,7 @@ describe("local-heavy-check-runtime", () => { expect(shouldAcquireLocalHeavyCheckLockForTsgo(["--version"])).toBe(false); expect(shouldAcquireLocalHeavyCheckLockForTsgo(["-v"])).toBe(false); expect(shouldAcquireLocalHeavyCheckLockForTsgo(["--init"])).toBe(false); + expect(shouldAcquireLocalHeavyCheckLockForTsgo(["--showConfig"])).toBe(false); }); it("keeps the heavy-check lock for real tsgo runs", () => { @@ -256,6 +257,9 @@ describe("local-heavy-check-runtime", () => { expect(shouldAcquireLocalHeavyCheckLockForOxlint(["-h"])).toBe(false); expect(shouldAcquireLocalHeavyCheckLockForOxlint(["--version"])).toBe(false); expect(shouldAcquireLocalHeavyCheckLockForOxlint(["-V"])).toBe(false); + expect(shouldAcquireLocalHeavyCheckLockForOxlint(["--rules"])).toBe(false); + expect(shouldAcquireLocalHeavyCheckLockForOxlint(["--print-config"])).toBe(false); + expect(shouldAcquireLocalHeavyCheckLockForOxlint(["--init"])).toBe(false); }); it("keeps the heavy-check lock for directory targets and broad oxlint runs", () => {