Enforce no-explicit-any; allow in tests

Enable @typescript-eslint/no-explicit-any as an error in the ESLint config to tighten typing across the codebase, and add an override to disable this rule for test files. Also apply non-functional cleanup in packages/proton/src/runtime.ts: reorder/imports and adjust formatting/indentation and string alignment for readability — no behavioral changes.
This commit is contained in:
手瓜一十雪 committed 2026-05-24 13:38:13 +08:00
1 parent acc5084647
commit 80ee12ecc2
36 files changed
+229 -147

No files matched your search

+3 -3
View File
@@ -139,7 +139,7 @@ export function register(h: ApiHandler, ctx: ApiActionContext): void {
try {
const essenceDataAll = await ctx.bridge.apis.web.getEssenceAll(groupId);
const allMsgs = essenceDataAll.flatMap((res: any) => res.data?.msg_list || []);
const allMsgs = essenceDataAll.flatMap((res) => res.data?.msg_list || []);
return okResponse(allMsgs);
} catch (e) {
@@ -347,7 +347,7 @@ export function register(h: ApiHandler, ctx: ApiActionContext): void {
message_id: 0,
};
if (groupId > 0) data.group_id = groupId;
return okResponse(data as any);
return okResponse(data as import('../types').JsonObject);
});
h.registerAction('upload_foward_msg', async (params) => {
@@ -985,7 +985,7 @@ export function register(h: ApiHandler, ctx: ApiActionContext): void {
}
});
const handleGroupSign = async (params: any) => {
const handleGroupSign = async (params: import('../types').JsonObject) => {
const groupId = asNumber(params.group_id);
if (!groupId) {
+3 -3
View File
@@ -26,10 +26,10 @@ export interface GroupEssenceMsgRet {
retcode: number;
data: {
is_end: boolean;
msg_list: any[];
[key: string]: any;
msg_list: JsonObject[];
[key: string]: JsonValue;
};
[key: string]: any;
[key: string]: JsonValue;
}
export interface ApiActionContext {
-2
View File
@@ -36,7 +36,6 @@ export class OneBotInstance {
private readonly reactionStore: ReactionStore;
private readonly networkManager: OneBotNetworkManager;
private readonly rkeyCache: RKeyCache;
private readonly ctx: OneBotInstanceContext;
private disposeEventPipeline: (() => void) | null = null;
private readonly pids = new Set<number>();
@@ -85,7 +84,6 @@ export class OneBotInstance {
cacheMessageMeta: (messageId, meta) => this.cacheMessageMeta(messageId, meta),
dispatchEvent: (event) => this.dispatchEvent(event),
};
this.ctx = ctx;
this.apiHandler = new ApiHandler(buildApiContext(ctx), uinNum > 0 ? uinNum : undefined);
this.networkManager = new OneBotNetworkManager();