fix(ci): satisfy lint contracts-ready lane

This commit is contained in:
imccyu
2026-08-11 19:25:43 +08:00
parent ac01c3b035
commit 3727e242cd
4 changed files with 6 additions and 17 deletions
+1 -5
View File
@@ -667,11 +667,7 @@ describe('Client TypeRT API', () => {
const seen: string[] = [] const seen: string[] = []
// The declared return is void, so nobody awaits an async listener: the // The declared return is void, so nobody awaits an async listener: the
// rejection has to be contained here or it escapes as an unhandled one. // rejection has to be contained here or it escapes as an unhandled one.
/* oxlint-disable-next-line typescript/no-misused-promises -- ctx.remote.$on('fixture/changed', () => Promise.reject(new Error('fixture async failure'))) // oxlint-disable-line typescript/no-misused-promises
* Deliberately the shape the contract does not invite: `$on` declares a void
* listener, and this pins what the service does when a caller hands it an
* async one anyway. */
ctx.remote.$on('fixture/changed', () => Promise.reject(new Error('fixture async failure')))
ctx.remote.$on('fixture/changed', (namespace) => { seen.push(namespace) }) ctx.remote.$on('fixture/changed', (namespace) => { seen.push(namespace) })
try { try {
ctx.remote.$dispatch('fixture/changed', ['credentials']) ctx.remote.$dispatch('fixture/changed', ['credentials'])
@@ -31,8 +31,6 @@ import type {} from '@deepseek-ai/dsh-api-remotes/types'
// never — the owning package's client-safe, type-only subpath supplies the // never — the owning package's client-safe, type-only subpath supplies the
// cordis `Events` entry (and with it the branded `SettingsNamespace`). // cordis `Events` entry (and with it the branded `SettingsNamespace`).
import type {} from '@deepseek-ai/dsh-settings/types' import type {} from '@deepseek-ai/dsh-settings/types'
import type { TypeRTClientRemote } from '@deepseek-ai/dsh-type-meta'
type SettingsFace = Pick<IApiClient, 'settings'> type SettingsFace = Pick<IApiClient, 'settings'>
/** /**
@@ -240,7 +238,7 @@ export class SettingsScopeService extends Service {
void controller.load() void controller.load()
} }
const disposers = [ const disposers = [
(ctx.get('remote') as TypeRTClientRemote).$on('settings/document-updated', refresh), (ctx.get('remote') as Context['remote']).$on('settings/document-updated', refresh),
ctx.on('connection/reset', () => { refresh() }), ctx.on('connection/reset', () => { refresh() }),
] ]
void controller.load() void controller.load()
@@ -229,10 +229,8 @@ function forwardedSettings(ns: string): HostFrame {
return { return {
type: 'host/remote-event', type: 'host/remote-event',
event: 'settings/document-updated', event: 'settings/document-updated',
/* oxlint-disable-next-line typescript/no-unsafe-assignment -- // The revision is the Host's own counter, so the matcher is the assertion.
* expect.any is typed `any`; the frame's args are JsonValue[]. The args: [ns, expect.any(Number)], // oxlint-disable-line typescript/no-unsafe-assignment
* revision is the Host's own counter, so the matcher is the assertion. */
args: [ns, expect.any(Number)],
} }
} }
@@ -134,11 +134,8 @@ function expectCode(code: SessionQueryErrorCode): Error {
} }
function rejectUnknown<T>(reason: unknown): Promise<T> { function rejectUnknown<T>(reason: unknown): Promise<T> {
return new Promise<T>((_resolve, reject) => { // Exercise containment for an implementation that violates the Error rejection convention.
// Exercise containment for an implementation that violates the Error rejection convention. return Promise.reject(reason) // oxlint-disable-line typescript/prefer-promise-reject-errors
// oxlint-disable-next-line typescript/prefer-promise-reject-errors
reject(reason)
})
} }
const cancellableSessionListings = [ const cancellableSessionListings = [