From 8aee72a48f0518ad9647c24d73c3530bcb1a0a14 Mon Sep 17 00:00:00 2001 From: Sirius Date: Mon, 9 Feb 2026 04:02:53 +0100 Subject: [PATCH] refactor(testing): remove unnecessary no-this-alias suppressions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Arrow functions in setTimeout already capture lexical `this` from the constructor — the `const self = this` alias was never needed. Removes 2 eslint-disable comments from test-client.test.ts. --- .../testing/tests/unit/server/test-client.test.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/testing/tests/unit/server/test-client.test.ts b/packages/testing/tests/unit/server/test-client.test.ts index a347b736..097eefe4 100644 --- a/packages/testing/tests/unit/server/test-client.test.ts +++ b/packages/testing/tests/unit/server/test-client.test.ts @@ -51,11 +51,9 @@ vi.mock("@modelcontextprotocol/sdk/client/streamableHttp.js", () => { onclose: (() => void) | null = null; constructor(url: unknown) { lastHttpArgs = url; - // eslint-disable-next-line @typescript-eslint/no-this-alias - const self = this; setTimeout(() => { - lastOnclose = self.onclose; - }, 0); + lastOnclose = this.onclose; + }); } async close() {} }, @@ -68,11 +66,9 @@ vi.mock("@modelcontextprotocol/sdk/client/stdio.js", () => { onclose: (() => void) | null = null; constructor(args: unknown) { lastStdioArgs = args; - // eslint-disable-next-line @typescript-eslint/no-this-alias - const self = this; setTimeout(() => { - lastOnclose = self.onclose; - }, 0); + lastOnclose = this.onclose; + }); } async close() {} },