mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 12:41:12 +00:00
refactor(lint): report unused disable directives in root oxlint
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user