Fix all ESLint errors

- Remove unused imports and variables
- Replace 'any' types with proper type guards
- Add comments to empty catch blocks
- Fix Response/Request type imports in logger
- Use 'unknown' instead of 'any' for generic types
- Remove unused createMcpServer and setSessionOwner imports

All ESLint checks now pass.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jerome 2025-07-10 16:52:32 +01:00
commit c6f3f40937
No known key found for this signature in database
3 changed files with 41 additions and 38 deletions

View file

@ -4,8 +4,7 @@ import { MockRedisClient, setRedisClient } from '../redis.js';
import {
ServerRedisTransport,
redisRelayToMcpServer,
shutdownSession,
setSessionOwner
shutdownSession
} from './redisTransport.js';
import { createMcpServer } from './mcp.js';
import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';

View file

@ -12,7 +12,6 @@ import {
isSessionOwnedBy
} from './redisTransport.js';
import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
import { createMcpServer } from './mcp.js';
describe('Redis Transport', () => {
let mockRedis: MockRedisClient;

View file

@ -28,8 +28,8 @@ function sendToMcpServer(sessionId: string, message: JSONRPCMessage, extra?: { a
logger.debug('Sending message to MCP server via Redis', {
sessionId,
channel: toServerChannel,
method: (message as any).method,
id: (message as any).id
method: ('method' in message ? message.method : undefined),
id: ('id' in message ? message.id : undefined)
});
const redisMessage: RedisMessage = { type: 'mcp', message, extra, options };
@ -125,7 +125,7 @@ export async function redisRelayToMcpServer(sessionId: string, transport: Transp
logger.debug('Relaying message from Redis to client', {
sessionId,
requestId,
method: (redisMessage.message as any).method
method: ('method' in redisMessage.message ? redisMessage.message.method : undefined)
});
await transport.send(redisMessage.message, redisMessage.options);
}
@ -148,7 +148,7 @@ export async function redisRelayToMcpServer(sessionId: string, transport: Transp
logger.debug('Setting up response subscription', {
sessionId,
messageId: message.id,
method: (message as any).method
method: ('method' in message ? message.method : undefined)
});
await subscribe(message.id.toString());
}
@ -235,8 +235,8 @@ export class ServerRedisTransport implements Transport {
logger.debug('Received MCP message from client', {
sessionId: this._sessionId,
method: (redisMessage.message as any).method,
id: (redisMessage.message as any).id
method: ('method' in redisMessage.message ? redisMessage.message.method : undefined),
id: ('id' in redisMessage.message ? redisMessage.message.id : undefined)
});
this.onmessage?.(redisMessage.message, redisMessage.extra);
@ -295,8 +295,8 @@ export class ServerRedisTransport implements Transport {
logger.debug('Sending message to client', {
sessionId: this._sessionId,
channel,
method: (message as any).method,
id: (message as any).id,
method: ('method' in message ? message.method : undefined),
id: ('id' in message ? message.id : undefined),
relatedRequestId
});