Unused error variables in catch block are not allowed (#24487)

This commit is contained in:
Alisa
2026-04-01 21:33:07 -07:00
committed by GitHub
parent 84936dc85d
commit 3344f6849c
92 changed files with 162 additions and 157 deletions
+1 -1
View File
@@ -1817,7 +1817,7 @@ export async function connectToMcpServer(
await mcpClient.notification({
method: 'notifications/roots/list_changed',
});
} catch (_) {
} catch {
// If this fails, its almost certainly because the connection was closed
// and we should just stop listening for future directory changes.
unlistenDirectories?.();
+1 -1
View File
@@ -830,7 +830,7 @@ describe('DiscoveredMCPTool', () => {
if (expectError) {
try {
await invocation.execute(controller.signal);
} catch (_error) {
} catch {
// Expected error
}
} else {
+1 -1
View File
@@ -678,7 +678,7 @@ describe('RipGrepTool', () => {
stdout.write(match + '\n');
linesPushed++;
}
} catch (_e) {
} catch {
clearInterval(pushInterval);
}
}, 1);
+2 -2
View File
@@ -749,7 +749,7 @@ export class ShellToolInvocation extends BaseToolInvocation<
) {
currentPath = path.dirname(currentPath);
}
} catch (_e) {
} catch {
/* ignore */
}
while (currentPath.length > 1) {
@@ -770,7 +770,7 @@ export class ShellToolInvocation extends BaseToolInvocation<
}
currentPath = path.dirname(currentPath);
}
} catch (_e) {
} catch {
// ignore
}
}
+1 -1
View File
@@ -367,7 +367,7 @@ export abstract class BaseToolInvocation<
try {
void this.messageBus.publish(request);
} catch (_error) {
} catch {
cleanup();
resolve('allow');
}
+2 -2
View File
@@ -73,7 +73,7 @@ function checkRateLimit(url: string): {
history.push(now);
hostRequestHistory.set(hostname, history);
return { allowed: true };
} catch (_e) {
} catch {
// If URL parsing fails, we fallback to allowed (should be caught by parsePrompt anyway)
return { allowed: true };
}
@@ -132,7 +132,7 @@ export function parsePrompt(text: string): {
`Unsupported protocol in URL: "${token}". Only http and https are supported.`,
);
}
} catch (_) {
} catch {
// new URL() threw, so it's malformed according to WHATWG standard
errors.push(`Malformed URL detected: "${token}".`);
}
@@ -95,7 +95,7 @@ export class XcodeMcpBridgeFixTransport
// If successful, populate structuredContent
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
result.structuredContent = parsed;
} catch (_) {
} catch {
// Ignored: Content is likely plain text, not JSON.
}
}