Skip to content

Commit 5d290c3

Browse files
Br1an67claude
andcommitted
fix(client): fix lint error - use numeric separator for intervalMs default
Add underscore separator to 30000 -> 30_000 for better readability and to satisfy unicorn/numeric-separators-style lint rule. Also apply prettier formatting to ping.test.ts. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8be3bde commit 5d290c3

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

packages/client/src/client/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export class Client extends Protocol<ClientContext> {
261261
this._enforceStrictCapabilities = options?.enforceStrictCapabilities ?? false;
262262
this._pingConfig = {
263263
enabled: options?.ping?.enabled ?? false,
264-
intervalMs: options?.ping?.intervalMs ?? 30000,
264+
intervalMs: options?.ping?.intervalMs ?? 30_000
265265
};
266266

267267
// Store list changed config for setup after connection (when we know server capabilities)

packages/client/test/client/ping.test.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ describe('Client periodic ping', () => {
7171

7272
// Mock the internal _requestWithSchema to track ping calls
7373
const originalRequest = (client as unknown as { _requestWithSchema: (...args: unknown[]) => Promise<unknown> })._requestWithSchema;
74-
(client as unknown as { _requestWithSchema: (...args: unknown[]) => Promise<unknown> })._requestWithSchema = async (...args: unknown[]) => {
74+
(client as unknown as { _requestWithSchema: (...args: unknown[]) => Promise<unknown> })._requestWithSchema = async (
75+
...args: unknown[]
76+
) => {
7577
const request = args[0] as { method: string };
7678
if (request?.method === 'ping') {
7779
pingCalls++;
@@ -148,8 +150,11 @@ describe('Client periodic ping', () => {
148150
);
149151

150152
let customPingCalls = 0;
151-
const originalRequest = (customIntervalClient as unknown as { _requestWithSchema: (...args: unknown[]) => Promise<unknown> })._requestWithSchema;
152-
(customIntervalClient as unknown as { _requestWithSchema: (...args: unknown[]) => Promise<unknown> })._requestWithSchema = async (...args: unknown[]) => {
153+
const originalRequest = (customIntervalClient as unknown as { _requestWithSchema: (...args: unknown[]) => Promise<unknown> })
154+
._requestWithSchema;
155+
(customIntervalClient as unknown as { _requestWithSchema: (...args: unknown[]) => Promise<unknown> })._requestWithSchema = async (
156+
...args: unknown[]
157+
) => {
153158
const request = args[0] as { method: string };
154159
if (request?.method === 'ping') {
155160
customPingCalls++;
@@ -179,7 +184,9 @@ describe('Client periodic ping', () => {
179184

180185
// Mock ping to fail
181186
const originalRequest = (client as unknown as { _requestWithSchema: (...args: unknown[]) => Promise<unknown> })._requestWithSchema;
182-
(client as unknown as { _requestWithSchema: (...args: unknown[]) => Promise<unknown> })._requestWithSchema = async (...args: unknown[]) => {
187+
(client as unknown as { _requestWithSchema: (...args: unknown[]) => Promise<unknown> })._requestWithSchema = async (
188+
...args: unknown[]
189+
) => {
183190
const request = args[0] as { method: string };
184191
if (request?.method === 'ping') {
185192
throw new Error('Ping failed');

0 commit comments

Comments
 (0)