chore(lint): exempt oidb-services from no-namespace + clean stale directives

The namespace-per-cmd OIDB service layer was tripping
`@typescript-eslint/no-namespace` across 59 files; namespace IS
the OidbCallSpec by design (structural typing, one file per
(cmd, subcmd)) so disable the rule for that subtree only. Drop
four stale `eslint-disable-next-line @typescript-eslint/no-empty-
object-type` comments that aren't needed anymore (the empty
`Params {}` shape no longer triggers the rule), and fix an indent
nit in the get-unidirectional-friend-list test.

`npx eslint packages` now reports 0 errors. The 5 remaining
warnings are unused-vars / unused-eslint-disable in unrelated
pre-existing files.
This commit is contained in:
DrSmoothl committed 2026-05-23 00:30:23 +08:00
1 parent 521808a6eb
commit 9b4ff9c5e9
6 files changed
+15 -6

No files matched your search

+13
View File
@@ -61,6 +61,19 @@ export default defineConfig([
],
},
},
{
// OIDB service layer is namespace-per-cmd by design — the
// structural-typing contract (namespace IS the OidbCallSpec) and
// the file:cmd 1:1 mapping are the whole point. Disable the
// module-syntax preference here only.
files: [
'packages/bridge/src/oidb-services/**/*.ts',
'packages/bridge/tests/oidb-services/**/*.ts',
],
rules: {
'@typescript-eslint/no-namespace': 'off',
},
},
{
files: ['packages/webui/src/**/*.{ts,tsx}', 'packages/ui/src/**/*.{ts,tsx}'],
extends: [reactHooks.configs.flat.recommended, reactRefresh.configs.vite],
@@ -17,7 +17,6 @@ export namespace FetchDownloadRkeys {
export const subCommand = 202;
export const uinForm = true;
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface Params {}
export type Deps = OidbSender;
@@ -18,7 +18,6 @@ export namespace FetchGroupList {
export const subCommand = 2;
export const uinForm = true;
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface Params {}
export type Deps = OidbSender;
@@ -21,7 +21,6 @@ export namespace GetUnidirectionalFriendList {
* `OidbSvcTrpcTcp.0xNNNN_N` namespace. */
export const wireName = (): string => 'MQUpdateSvc_com_qq_ti.web.OidbSvc.0xe17_0';
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface Params {}
export type Deps = OidbSender & Pick<BridgeContext, 'identity'>;
@@ -20,7 +20,6 @@ export namespace ForceFetchClientKey {
export const command = 0x102A;
export const subCommand = 1;
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface Params {}
export type Deps = OidbSender;
@@ -9,8 +9,8 @@ import { GetUnidirectionalFriendList } from '../../../src/oidb-services/profile/
function makeDeps(responseJson?: unknown) {
const responseData = responseJson !== undefined
? Buffer.from(protobuf_encode<OidbBase<Oidb0xe17Resp>>({
body: { jsonBody: JSON.stringify(responseJson) },
}))
body: { jsonBody: JSON.stringify(responseJson) },
}))
: Buffer.alloc(0);
const r: SendPacketResult = { success: true, gotResponse: true, errorCode: 0, errorMessage: '', responseData };
return {