Disallow and suppress unsafe assignment (#19736)

This commit is contained in:
Christian Gunderman
2026-02-20 22:28:55 +00:00
committed by GitHub
parent 3e786a161e
commit 981e9a978e
71 changed files with 149 additions and 22 deletions
@@ -36,11 +36,13 @@ describe('Circular Reference Integration Test', () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const socketLike: any = {
_httpMessage: {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
agent: proxyAgentLike,
socket: null,
},
};
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
socketLike._httpMessage.socket = socketLike; // Create circular reference
proxyAgentLike.sockets['cloudcode-pa.googleapis.com:443'] = [socketLike];
@@ -49,6 +51,7 @@ describe('Circular Reference Integration Test', () => {
error: new Error('Network error'),
function_args: {
filePath: '/test/file.txt',
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
httpAgent: proxyAgentLike, // This would cause the circular reference
},
};