From 8b7a90d2a866fda2eb4ada593d4e5cf87415b4f7 Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 16 Dec 2025 13:49:42 -0500 Subject: [PATCH] fix: remove eslint directives and unused catch variable in notifications.ts --- src/ui/notifications.ts | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/ui/notifications.ts b/src/ui/notifications.ts index 370dafa..88635b9 100644 --- a/src/ui/notifications.ts +++ b/src/ui/notifications.ts @@ -7,8 +7,7 @@ import { MCPPluginSettings } from '../types/settings-types'; export interface NotificationHistoryEntry { timestamp: number; toolName: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Tool arguments come from JSON-RPC and can be any valid JSON structure - args: any; + args: Record; success: boolean; duration?: number; error?: string; @@ -75,8 +74,7 @@ export class NotificationManager { /** * Show notification for tool call start */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Tool arguments come from JSON-RPC and can be any valid JSON structure - showToolCall(toolName: string, args: any, duration?: number): void { + showToolCall(toolName: string, args: Record, duration?: number): void { if (!this.shouldShowNotification()) { return; } @@ -142,8 +140,7 @@ export class NotificationManager { /** * Format arguments for display */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Tool arguments come from JSON-RPC and can be any valid JSON structure - private formatArgs(args: any): string { + private formatArgs(args: Record): string { if (!this.settings.showParameters) { return ''; } @@ -156,13 +153,13 @@ export class NotificationManager { // Extract key parameters for display const keyParams: string[] = []; - if (args.path) { + if (args.path && typeof args.path === 'string') { keyParams.push(`path: "${this.truncateString(args.path, 30)}"`); } - if (args.query) { + if (args.query && typeof args.query === 'string') { keyParams.push(`query: "${this.truncateString(args.query, 30)}"`); } - if (args.folder) { + if (args.folder && typeof args.folder === 'string') { keyParams.push(`folder: "${this.truncateString(args.folder, 30)}"`); } if (args.recursive !== undefined) { @@ -176,7 +173,7 @@ export class NotificationManager { } return keyParams.join(', '); - } catch (e) { + } catch { return ''; } }