mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-23 11:49:38 +00:00
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:
@@ -777,6 +777,7 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider<
|
||||
dotAccessorContext = { range, text };
|
||||
}
|
||||
}
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
const isIncomplete = !!response.body.isIncomplete || (response.metadata as any)?.isIncomplete;
|
||||
const entries = response.body.entries;
|
||||
const metadata = response.metadata;
|
||||
|
||||
@@ -105,8 +105,10 @@ function toTsTriggerReason(context: vscode.SignatureHelpContext): Proto.Signatur
|
||||
case vscode.SignatureHelpTriggerKind.TriggerCharacter:
|
||||
if (context.triggerCharacter) {
|
||||
if (context.isRetrigger) {
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
return { kind: 'retrigger', triggerCharacter: context.triggerCharacter as any };
|
||||
} else {
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
return { kind: 'characterTyped', triggerCharacter: context.triggerCharacter as any };
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -183,6 +183,7 @@ class SyncedBuffer {
|
||||
.filter(x => x.languages.indexOf(this.document.languageId) >= 0);
|
||||
|
||||
if (tsPluginsForDocument.length) {
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
(args as any).plugins = tsPluginsForDocument.map(plugin => plugin.name);
|
||||
}
|
||||
|
||||
|
||||
@@ -283,6 +283,7 @@ export class SingleTsServer extends Disposable implements ITypeScriptServer {
|
||||
}
|
||||
|
||||
this._requestQueue.enqueue(requestInfo);
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
if (args && typeof (args as any).$traceId === 'string') {
|
||||
const queueLength = this._requestQueue.length - 1;
|
||||
const pendingResponses = this._pendingResponses.size;
|
||||
@@ -298,6 +299,7 @@ export class SingleTsServer extends Disposable implements ITypeScriptServer {
|
||||
data.pendingCommands = this.getPendingCommands();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
this._telemetryReporter.logTraceEvent('TSServer.enqueueRequest', (args as any).$traceId, JSON.stringify(data));
|
||||
}
|
||||
this.sendNextRequests();
|
||||
|
||||
@@ -10,6 +10,7 @@ export function isWeb(): boolean {
|
||||
}
|
||||
|
||||
export function isWebAndHasSharedArrayBuffers(): boolean {
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
return isWeb() && (globalThis as any)['crossOriginIsolated'];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user