refactor(lint): report unused disable directives in root oxlint

This commit is contained in:
Vincent Koc
2026-04-06 16:02:38 +01:00
parent 9c3d9c5c18
commit eef20a87d0
2 changed files with 6 additions and 8 deletions

View File

@@ -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");

View File

@@ -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",