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:
1 parent
acc5084647
commit
80ee12ecc2
36 files changed
+229
-147
No files matched your search
@@ -10,15 +10,18 @@ import { invokeOidb, type OidbSender } from '../../oidb-service';
|
||||
import type { BridgeContext } from '../../bridge-context';
|
||||
|
||||
export interface LikeInfo {
|
||||
[key: string]: import('@snowluma/common/json').JsonValue;
|
||||
uid: string;
|
||||
time: number;
|
||||
favoriteInfo: {
|
||||
[key: string]: import('@snowluma/common/json').JsonValue;
|
||||
total_count: number;
|
||||
last_time: number;
|
||||
today_count: number;
|
||||
userInfos: never[];
|
||||
};
|
||||
voteInfo: {
|
||||
[key: string]: import('@snowluma/common/json').JsonValue;
|
||||
total_count: number;
|
||||
new_count: number;
|
||||
new_nearby_count: number;
|
||||
|
||||
@@ -13,6 +13,10 @@ import type { Oidb0xe17Req, Oidb0xe17Resp } from '@snowluma/proto-defs/oidb-acti
|
||||
import { invokeOidb, type OidbSender } from '../../oidb-service';
|
||||
import type { BridgeContext } from '../../bridge-context';
|
||||
|
||||
export interface UnidirectionalFriendEntry {
|
||||
[key: string]: import('@snowluma/common/json').JsonValue;
|
||||
}
|
||||
|
||||
export namespace GetUnidirectionalFriendList {
|
||||
export const command = 0xE17;
|
||||
export const subCommand = 0;
|
||||
@@ -35,9 +39,9 @@ export namespace GetUnidirectionalFriendList {
|
||||
return { jsonBody: JSON.stringify(reqObj) };
|
||||
};
|
||||
|
||||
export const deserialize = (_ctx: Deps, body: Oidb0xe17Resp): unknown[] => {
|
||||
export const deserialize = (_ctx: Deps, body: Oidb0xe17Resp): UnidirectionalFriendEntry[] => {
|
||||
if (!body || !body.jsonBody) throw new Error('get unidirectional friend list empty');
|
||||
const parsed = JSON.parse(body.jsonBody);
|
||||
const parsed = JSON.parse(body.jsonBody) as { rpt_block_list?: UnidirectionalFriendEntry[] };
|
||||
return parsed.rpt_block_list || [];
|
||||
};
|
||||
|
||||
@@ -47,6 +51,6 @@ export namespace GetUnidirectionalFriendList {
|
||||
export const decode = (bytes: Uint8Array): OidbBase<Oidb0xe17Resp> =>
|
||||
protobuf_decode<OidbBase<Oidb0xe17Resp>>(bytes);
|
||||
|
||||
export const invoke = (deps: Deps): Promise<unknown[]> =>
|
||||
export const invoke = (deps: Deps): Promise<UnidirectionalFriendEntry[]> =>
|
||||
invokeOidb(deps, GetUnidirectionalFriendList, {});
|
||||
}
|
||||
Reference in new issue
Block a user