Add lint rule for as any and bulk ignore all existing breaks

For #269213

This adds a new eslint rule for `as any` and `<any>({... })`. We'd like to remove almost all of these, however right now the first goal is to prevent them in new code. That's why with this first PR I simply add `eslint-disable` comments for all breaks

Trying to get this change in soon after branching off for release to hopefully minimize disruption during debt week work
This commit is contained in:
Matt Bierner
2025-10-02 23:38:33 -07:00
parent 96aa43fe7a
commit 360c9fd134
465 changed files with 1188 additions and 0 deletions
@@ -89,8 +89,10 @@ export function connectProxyResolver(
promises.push(certs);
}
// Using https.globalAgent because it is shared with proxy.test.ts and mutable.
// eslint-disable-next-line local/code-no-any-casts
if (initData.environment.extensionTestsLocationURI && (https.globalAgent as any).testCertificates?.length) {
extHostLogService.trace('ProxyResolver#loadAdditionalCertificates: Loading test certificates');
// eslint-disable-next-line local/code-no-any-casts
promises.push(Promise.resolve((https.globalAgent as any).testCertificates as string[]));
}
return (await Promise.all(promises)).flat();
@@ -98,6 +100,7 @@ export function connectProxyResolver(
env: process.env,
};
const { resolveProxyWithRequest, resolveProxyURL } = createProxyResolver(params);
// eslint-disable-next-line local/code-no-any-casts
const target = (proxyAgent as any).default || proxyAgent;
target.resolveProxyURL = resolveProxyURL;
@@ -120,10 +123,13 @@ const unsafeHeaders = [
];
function patchGlobalFetch(params: ProxyAgentParams, configProvider: ExtHostConfigProvider, mainThreadTelemetry: MainThreadTelemetryShape, initData: IExtensionHostInitData, resolveProxyURL: (url: string) => Promise<string | undefined>, disposables: DisposableStore) {
// eslint-disable-next-line local/code-no-any-casts
if (!(globalThis as any).__vscodeOriginalFetch) {
const originalFetch = globalThis.fetch;
// eslint-disable-next-line local/code-no-any-casts
(globalThis as any).__vscodeOriginalFetch = originalFetch;
const patchedFetch = proxyAgent.createFetchPatch(params, originalFetch, resolveProxyURL);
// eslint-disable-next-line local/code-no-any-casts
(globalThis as any).__vscodePatchedFetch = patchedFetch;
let useElectronFetch = false;
if (!initData.remote.isRemote) {
@@ -364,6 +370,7 @@ function configureModuleLoading(extensionService: ExtHostExtensionService, looku
cache[request] = undici;
} else {
const mod = lookup[request];
// eslint-disable-next-line local/code-no-any-casts
cache[request] = <any>{ ...mod }; // Copy to work around #93167.
}
}