mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 16:28:26 +00:00
chore: Enable typescript/no-explicit-any rule.
This commit is contained in:
@@ -49,7 +49,9 @@ describe("parseExecApprovalData", () => {
|
||||
});
|
||||
|
||||
it("rejects null/undefined input", () => {
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
expect(parseExecApprovalData(null as any)).toBeNull();
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
expect(parseExecApprovalData(undefined as any)).toBeNull();
|
||||
});
|
||||
|
||||
|
||||
@@ -31,10 +31,13 @@ describe("discord processDiscordMessage inbound contract", () => {
|
||||
const storePath = path.join(dir, "sessions.json");
|
||||
|
||||
await processDiscordMessage({
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
cfg: { messages: {}, session: { store: storePath } } as any,
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
discordConfig: {} as any,
|
||||
accountId: "default",
|
||||
token: "token",
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
runtime: { log: () => {}, error: () => {} } as any,
|
||||
guildHistories: new Map(),
|
||||
historyLimit: 0,
|
||||
@@ -44,19 +47,23 @@ describe("discord processDiscordMessage inbound contract", () => {
|
||||
replyToMode: "off",
|
||||
ackReactionScope: "direct",
|
||||
groupPolicy: "open",
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
data: { guild: null } as any,
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
client: { rest: {} } as any,
|
||||
message: {
|
||||
id: "m1",
|
||||
channelId: "c1",
|
||||
timestamp: new Date().toISOString(),
|
||||
attachments: [],
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
} as any,
|
||||
author: {
|
||||
id: "U1",
|
||||
username: "alice",
|
||||
discriminator: "0",
|
||||
globalName: "Alice",
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
} as any,
|
||||
channelInfo: null,
|
||||
channelName: undefined,
|
||||
@@ -86,7 +93,9 @@ describe("discord processDiscordMessage inbound contract", () => {
|
||||
accountId: "default",
|
||||
sessionKey: "agent:main:discord:dm:u1",
|
||||
mainSessionKey: "agent:main:main",
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
} as any,
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
} as any);
|
||||
|
||||
expect(capturedCtx).toBeTruthy();
|
||||
|
||||
@@ -105,6 +105,7 @@ describe("processDiscordMessage ack reactions", () => {
|
||||
sender: { label: "user" },
|
||||
});
|
||||
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
await processDiscordMessage(ctx as any);
|
||||
|
||||
expect(reactMessageDiscord).not.toHaveBeenCalled();
|
||||
@@ -117,6 +118,7 @@ describe("processDiscordMessage ack reactions", () => {
|
||||
sender: { label: "user" },
|
||||
});
|
||||
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
await processDiscordMessage(ctx as any);
|
||||
|
||||
expect(reactMessageDiscord).toHaveBeenCalledWith("c1", "m1", "👀", { rest: {} });
|
||||
|
||||
@@ -28,6 +28,7 @@ export function resolveDiscordWebhookId(message: DiscordWebhookMessageLike): str
|
||||
|
||||
export function resolveDiscordSenderIdentity(params: {
|
||||
author: User;
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
member?: any;
|
||||
pluralkitInfo?: PluralKitMessageInfo | null;
|
||||
}): DiscordSenderIdentity {
|
||||
@@ -73,6 +74,7 @@ export function resolveDiscordSenderIdentity(params: {
|
||||
|
||||
export function resolveDiscordSenderLabel(params: {
|
||||
author: User;
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
member?: any;
|
||||
pluralkitInfo?: PluralKitMessageInfo | null;
|
||||
}): string {
|
||||
|
||||
Reference in New Issue
Block a user