chore: Enable typescript/no-explicit-any rule.

This commit is contained in:
cpojer
2026-02-02 15:45:05 +09:00
parent baa1e95b9d
commit 935a0e5708
65 changed files with 248 additions and 80 deletions

View File

@@ -132,6 +132,7 @@ export class GatewayClient {
return new Error("gateway tls fingerprint mismatch");
}
return undefined;
// oxlint-disable-next-line typescript/no-explicit-any
}) as any;
}
this.ws = new WebSocket(url, wsOptions);

View File

@@ -128,12 +128,14 @@ describe("timestampOptsFromConfig", () => {
userTimezone: "America/Chicago",
},
},
// oxlint-disable-next-line typescript/no-explicit-any
} as any);
expect(opts.timezone).toBe("America/Chicago");
});
it("falls back gracefully with empty config", () => {
// oxlint-disable-next-line typescript/no-explicit-any
const opts = timestampOptsFromConfig({} as any);
expect(opts.timezone).toBeDefined(); // resolveUserTimezone provides a default

View File

@@ -310,6 +310,7 @@ describe("gateway server auth/connect", () => {
gateway: {
trustedProxies: ["127.0.0.1"],
},
// oxlint-disable-next-line typescript/no-explicit-any
} as any);
const prevToken = process.env.OPENCLAW_GATEWAY_TOKEN;
process.env.OPENCLAW_GATEWAY_TOKEN = "secret";

View File

@@ -34,6 +34,7 @@ describe("POST /tools/invoke", () => {
},
},
],
// oxlint-disable-next-line typescript/no-explicit-any
} as any;
const port = await getFreePort();
@@ -60,12 +61,14 @@ describe("POST /tools/invoke", () => {
// No explicit tool allowlist; rely on profile + alsoAllow.
testState.agentsConfig = {
list: [{ id: "main" }],
// oxlint-disable-next-line typescript/no-explicit-any
} as any;
// minimal profile does NOT include agents_list, but alsoAllow should.
const { writeConfigFile } = await import("../config/config.js");
await writeConfigFile({
tools: { profile: "minimal", alsoAllow: ["agents_list"] },
// oxlint-disable-next-line typescript/no-explicit-any
} as any);
const port = await getFreePort();
@@ -88,6 +91,7 @@ describe("POST /tools/invoke", () => {
it("supports tools.alsoAllow without allow/profile (implicit allow-all)", async () => {
testState.agentsConfig = {
list: [{ id: "main" }],
// oxlint-disable-next-line typescript/no-explicit-any
} as any;
const { CONFIG_PATH } = await import("../config/config.js");
@@ -125,6 +129,7 @@ describe("POST /tools/invoke", () => {
},
},
],
// oxlint-disable-next-line typescript/no-explicit-any
} as any;
const port = await getFreePort();
@@ -175,6 +180,7 @@ describe("POST /tools/invoke", () => {
},
},
],
// oxlint-disable-next-line typescript/no-explicit-any
} as any;
const port = await getFreePort();
@@ -210,6 +216,7 @@ describe("POST /tools/invoke", () => {
},
},
],
// oxlint-disable-next-line typescript/no-explicit-any
} as any;
const port = await getFreePort();
@@ -239,6 +246,7 @@ describe("POST /tools/invoke", () => {
},
},
],
// oxlint-disable-next-line typescript/no-explicit-any
} as any;
const port = await getFreePort();
@@ -266,11 +274,13 @@ describe("POST /tools/invoke", () => {
},
},
],
// oxlint-disable-next-line typescript/no-explicit-any
} as any;
const { writeConfigFile } = await import("../config/config.js");
await writeConfigFile({
tools: { profile: "minimal" },
// oxlint-disable-next-line typescript/no-explicit-any
} as any);
const port = await getFreePort();
@@ -305,6 +315,7 @@ describe("POST /tools/invoke", () => {
},
},
],
// oxlint-disable-next-line typescript/no-explicit-any
} as any;
testState.sessionConfig = { mainKey: "primary" };

View File

@@ -230,12 +230,14 @@ export async function handleToolsInvokeHttpRequest(
const coreToolNames = new Set(
allTools
// oxlint-disable-next-line typescript/no-explicit-any
.filter((tool) => !getPluginToolMeta(tool as any))
.map((tool) => normalizeToolName(tool.name))
.filter(Boolean),
);
const pluginGroups = buildPluginToolGroups({
tools: allTools,
// oxlint-disable-next-line typescript/no-explicit-any
toolMeta: (tool) => getPluginToolMeta(tool as any),
});
const resolvePolicy = (policy: typeof profilePolicy, label: string) => {
@@ -306,10 +308,12 @@ export async function handleToolsInvokeHttpRequest(
try {
const toolArgs = mergeActionIntoArgsIfSupported({
// oxlint-disable-next-line typescript/no-explicit-any
toolSchema: (tool as any).parameters,
action,
args,
});
// oxlint-disable-next-line typescript/no-explicit-any
const result = await (tool as any).execute?.(`http-${Date.now()}`, toolArgs);
sendJson(res, 200, { ok: true, result });
} catch (err) {