diff --git a/scripts/lib/local-heavy-check-runtime.mjs b/scripts/lib/local-heavy-check-runtime.mjs index a5b14ca239..a18fbfc58f 100644 --- a/scripts/lib/local-heavy-check-runtime.mjs +++ b/scripts/lib/local-heavy-check-runtime.mjs @@ -55,6 +55,12 @@ export function applyLocalOxlintPolicy(args, env, hostResources) { insertBeforeSeparator(nextArgs, "--type-aware"); insertBeforeSeparator(nextArgs, "--tsconfig", "tsconfig.oxlint.json"); + if ( + !hasFlag(nextArgs, "--report-unused-disable-directives") && + !hasFlag(nextArgs, "--report-unused-disable-directives-severity") + ) { + insertBeforeSeparator(nextArgs, "--report-unused-disable-directives-severity", "error"); + } if (shouldThrottleLocalHeavyChecks(nextEnv, hostResources)) { insertBeforeSeparator(nextArgs, "--threads=1"); diff --git a/scripts/lib/run-extension-oxlint.mjs b/scripts/lib/run-extension-oxlint.mjs index 60da822065..bce3e54f68 100644 --- a/scripts/lib/run-extension-oxlint.mjs +++ b/scripts/lib/run-extension-oxlint.mjs @@ -5,7 +5,6 @@ import path from "node:path"; import { acquireLocalHeavyCheckLockSync, applyLocalOxlintPolicy, - hasFlag, } from "./local-heavy-check-runtime.mjs"; export function runExtensionOxlint(params) { @@ -33,13 +32,6 @@ export function runExtensionOxlint(params) { writeTempOxlintConfig(repoRoot, tempConfigPath); const baseArgs = ["-c", tempConfigPath, ...process.argv.slice(2), ...extensionFiles]; - if ( - !hasFlag(baseArgs, "--report-unused-disable-directives") && - !hasFlag(baseArgs, "--report-unused-disable-directives-severity") - ) { - baseArgs.unshift("error"); - baseArgs.unshift("--report-unused-disable-directives-severity"); - } const { args: finalArgs, env } = applyLocalOxlintPolicy(baseArgs, process.env); const result = spawnSync(oxlintPath, finalArgs, { stdio: "inherit",