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:
6 files changed
+15
-6
No files matched your search
@@ -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}'],
|
files: ['packages/webui/src/**/*.{ts,tsx}', 'packages/ui/src/**/*.{ts,tsx}'],
|
||||||
extends: [reactHooks.configs.flat.recommended, reactRefresh.configs.vite],
|
extends: [reactHooks.configs.flat.recommended, reactRefresh.configs.vite],
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ export namespace FetchDownloadRkeys {
|
|||||||
export const subCommand = 202;
|
export const subCommand = 202;
|
||||||
export const uinForm = true;
|
export const uinForm = true;
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
||||||
export interface Params {}
|
export interface Params {}
|
||||||
|
|
||||||
export type Deps = OidbSender;
|
export type Deps = OidbSender;
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ export namespace FetchGroupList {
|
|||||||
export const subCommand = 2;
|
export const subCommand = 2;
|
||||||
export const uinForm = true;
|
export const uinForm = true;
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
||||||
export interface Params {}
|
export interface Params {}
|
||||||
|
|
||||||
export type Deps = OidbSender;
|
export type Deps = OidbSender;
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ export namespace GetUnidirectionalFriendList {
|
|||||||
* `OidbSvcTrpcTcp.0xNNNN_N` namespace. */
|
* `OidbSvcTrpcTcp.0xNNNN_N` namespace. */
|
||||||
export const wireName = (): string => 'MQUpdateSvc_com_qq_ti.web.OidbSvc.0xe17_0';
|
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 interface Params {}
|
||||||
|
|
||||||
export type Deps = OidbSender & Pick<BridgeContext, 'identity'>;
|
export type Deps = OidbSender & Pick<BridgeContext, 'identity'>;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ export namespace ForceFetchClientKey {
|
|||||||
export const command = 0x102A;
|
export const command = 0x102A;
|
||||||
export const subCommand = 1;
|
export const subCommand = 1;
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
||||||
export interface Params {}
|
export interface Params {}
|
||||||
|
|
||||||
export type Deps = OidbSender;
|
export type Deps = OidbSender;
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import { GetUnidirectionalFriendList } from '../../../src/oidb-services/profile/
|
|||||||
function makeDeps(responseJson?: unknown) {
|
function makeDeps(responseJson?: unknown) {
|
||||||
const responseData = responseJson !== undefined
|
const responseData = responseJson !== undefined
|
||||||
? Buffer.from(protobuf_encode<OidbBase<Oidb0xe17Resp>>({
|
? Buffer.from(protobuf_encode<OidbBase<Oidb0xe17Resp>>({
|
||||||
body: { jsonBody: JSON.stringify(responseJson) },
|
body: { jsonBody: JSON.stringify(responseJson) },
|
||||||
}))
|
}))
|
||||||
: Buffer.alloc(0);
|
: Buffer.alloc(0);
|
||||||
const r: SendPacketResult = { success: true, gotResponse: true, errorCode: 0, errorMessage: '', responseData };
|
const r: SendPacketResult = { success: true, gotResponse: true, errorCode: 0, errorMessage: '', responseData };
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in new issue
Block a user