Skip to content

Commit

Permalink
Remove all tslint comments (microsoft#15031)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettcannon authored Dec 21, 2020
1 parent db8e1e2 commit c1a8d94
Show file tree
Hide file tree
Showing 595 changed files with 607 additions and 2,009 deletions.
2 changes: 1 addition & 1 deletion build/webpack/loaders/externalizeDependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function replaceModule(prefixRegex, prefix, contents, moduleName, quotes) {
const stringToReplaceWith = `${prefix}${quotes}./node_modules/${moduleName}${quotes}`;
return contents.replace(new RegExp(stringToSearch, 'gm'), stringToReplaceWith);
}
// tslint:disable:no-default-export no-invalid-this

function default_1(source) {
common.nodeModulesToReplacePaths.forEach((moduleName) => {
if (source.indexOf(moduleName) > 0) {
Expand Down
4 changes: 2 additions & 2 deletions build/webpack/webpack.extension.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const path = require('path');
const tsconfig_paths_webpack_plugin = require('tsconfig-paths-webpack-plugin');
const constants = require('../constants');
const common = require('./common');
// tslint:disable-next-line:no-var-requires no-require-imports

const configFileName = path.join(constants.ExtensionRootDir, 'tsconfig.extension.json');
// Some modules will be pre-genearted and stored in out/.. dir and they'll be referenced via NormalModuleReplacementPlugin
// We need to ensure they do not get bundled into the output (as they are large).
Expand Down Expand Up @@ -69,5 +69,5 @@ const config = {
devtoolModuleFilenameTemplate: '../../[resource-path]',
},
};
// tslint:disable-next-line:no-default-export

exports.default = config;
3 changes: 1 addition & 2 deletions build/webpack/webpack.extension.dependencies.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.
'use strict';

// tslint:disable-next-line: no-require-imports
const copyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
const constants = require('../constants');
Expand Down Expand Up @@ -38,5 +37,5 @@ const config = {
devtoolModuleFilenameTemplate: '../../[resource-path]',
},
};
// tslint:disable-next-line:no-default-export

exports.default = config;
1 change: 0 additions & 1 deletion src/client/activation/common/activatorBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ export abstract class LanguageServerActivatorBase implements ILanguageServerActi
token,
);
if (result && result.length) {
// tslint:disable-next-line: no-any
if ((result[0] as any).range) {
// Document symbols
const docSymbols = result as vscodeLanguageClient.DocumentSymbol[];
Expand Down
1 change: 0 additions & 1 deletion src/client/activation/common/analysisOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export abstract class LanguageServerAnalysisOptionsBase implements ILanguageServ
return PYTHON;
}

// tslint:disable-next-line: no-any
protected async getInitializationOptions(): Promise<any> {
return undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion src/client/activation/common/cancellationUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function tryRun(callback: () => void) {
try {
callback();
} catch (e) {
// tslint:disable-next-line: no-empty
// No body.
}
}

Expand Down
5 changes: 0 additions & 5 deletions src/client/activation/common/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import {
IPlatformData,
} from '../types';

// tslint:disable:no-require-imports no-any

const downloadFileExtension = '.nupkg';

@injectable()
Expand All @@ -50,7 +48,6 @@ export class LanguageServerDownloader implements ILanguageServerDownloader {
if (uri.startsWith('https:')) {
const cfg = this.workspace.getConfiguration('http', resource);
if (!cfg.get<boolean>('proxyStrictSSL', true)) {
// tslint:disable-next-line:no-http-string
uri = uri.replace(/^https:/, 'http:');
}
}
Expand Down Expand Up @@ -153,7 +150,6 @@ export class LanguageServerDownloader implements ILanguageServerDownloader {
location: ProgressLocation.Window,
},
(progress) => {
// tslint:disable-next-line:no-require-imports no-var-requires
const StreamZip = require('node-stream-zip');
const zip = new StreamZip({
file: tempFilePath,
Expand Down Expand Up @@ -193,7 +189,6 @@ export class LanguageServerDownloader implements ILanguageServerDownloader {
const platformData = this.services.get<IPlatformData>(IPlatformData);
const executablePath = path.join(destinationFolder, platformData.engineExecutableName);
await this.fs.chmod(executablePath, '0764'); // -rwxrw-r--
// tslint:disable-next-line: no-empty
} catch {}
}

Expand Down
2 changes: 1 addition & 1 deletion src/client/activation/jedi/activator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

import { inject, injectable } from 'inversify';
// tslint:disable-next-line: import-name

import { IWorkspaceService } from '../../common/application/types';
import { IFileSystem } from '../../common/platform/types';
import { IConfigurationService, Resource } from '../../common/types';
Expand Down
1 change: 0 additions & 1 deletion src/client/activation/jedi/languageClientFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { IInterpreterService } from '../../interpreter/contracts';
import { PythonEnvironment } from '../../pythonEnvironments/info';
import { ILanguageClientFactory } from '../types';

// tslint:disable:no-require-imports no-require-imports no-var-requires max-classes-per-file
const languageClientName = 'Python Tools';

@injectable()
Expand Down
2 changes: 1 addition & 1 deletion src/client/activation/jedi/multiplexingActivator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
TextDocument,
} from 'vscode';
import { ServerCapabilities } from 'vscode-languageserver-protocol';
// tslint:disable-next-line: import-name

import { IWorkspaceService } from '../../common/application/types';
import { isTestExecution } from '../../common/constants';
import { JediLSP } from '../../common/experiments/groups';
Expand Down
9 changes: 2 additions & 7 deletions src/client/activation/languageClientMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export class LanguageClientMiddleware implements Middleware {
public eventCount: number = 0;

public workspace = {
// tslint:disable:no-any
configuration: (
params: ConfigurationParams,
token: CancellationToken,
Expand Down Expand Up @@ -97,7 +96,6 @@ export class LanguageClientMiddleware implements Middleware {

return addPythonPath(result);
},
// tslint:enable:no-any
};
private notebookAddon: NotebookMiddlewareAddon | undefined;

Expand Down Expand Up @@ -369,7 +367,7 @@ export class LanguageClientMiddleware implements Middleware {
// middleware, it calls into the notebook middleware first.
if (this.notebookAddon) {
// It would be nice to use args.callee, but not supported in strict mode
// tslint:disable-next-line: no-any

return (this.notebookAddon as any)[funcName](...args);
} else {
return args[args.length - 1](...args);
Expand All @@ -378,11 +376,9 @@ export class LanguageClientMiddleware implements Middleware {
}

function captureTelemetryForLSPMethod(method: string, debounceMilliseconds: number) {
// tslint:disable-next-line:no-function-expression no-any
return function (_target: Object, _propertyKey: string, descriptor: TypedPropertyDescriptor<any>) {
const originalMethod = descriptor.value;

// tslint:disable-next-line:no-any
descriptor.value = function (this: LanguageClientMiddleware, ...args: any[]) {
const eventName = this.eventName;
if (!eventName) {
Expand Down Expand Up @@ -417,10 +413,9 @@ function captureTelemetryForLSPMethod(method: string, debounceMilliseconds: numb
};

const stopWatch = new StopWatch();
// tslint:disable-next-line:no-unsafe-any

const result = originalMethod.apply(this, args);

// tslint:disable-next-line:no-unsafe-any
if (result && isThenable<void>(result)) {
result.then(() => {
sendTelemetryEvent(eventName, stopWatch.elapsedTime, properties);
Expand Down
2 changes: 1 addition & 1 deletion src/client/activation/languageServer/activator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class DotNetLanguageServerActivator extends LanguageServerActivatorBase {
languageServerFolderPath,
'Microsoft.Python.LanguageServer.runtimeconfig.json',
);
// tslint:disable-next-line:no-any

let content: any = {};
if (await this.fs.fileExists(targetJsonFile)) {
try {
Expand Down
2 changes: 0 additions & 2 deletions src/client/activation/languageServer/languageClientFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import { IEnvironmentActivationService } from '../../interpreter/activation/type
import { PythonEnvironment } from '../../pythonEnvironments/info';
import { ILanguageClientFactory, ILanguageServerFolderService, IPlatformData } from '../types';

// tslint:disable:no-require-imports no-require-imports no-var-requires max-classes-per-file

const dotNetCommand = 'dotnet';
const languageClientName = 'Python Tools';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class DotNetLanguageServerFolderService extends LanguageServerFolderServi
if (appEnv) {
minVersion = appEnv.packageJson[DotNetLanguageServerMinVersionKey] as string;
}
// tslint:disable-next-line: no-empty
} catch {}
return minVersion;
}
Expand Down
2 changes: 1 addition & 1 deletion src/client/activation/node/activator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { inject, injectable } from 'inversify';
import { CancellationToken, CompletionItem, ProviderResult } from 'vscode';
// tslint:disable-next-line: import-name

import ProtocolCompletionItem from 'vscode-languageclient/lib/common/protocolCompletionItem';
import { CompletionResolveRequest } from 'vscode-languageclient/node';
import { IApplicationEnvironment, IApplicationShell, IWorkspaceService } from '../../common/application/types';
Expand Down
1 change: 0 additions & 1 deletion src/client/activation/node/languageClientFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { PythonEnvironment } from '../../pythonEnvironments/info';
import { FileBasedCancellationStrategy } from '../common/cancellationUtils';
import { ILanguageClientFactory, ILanguageServerFolderService } from '../types';

// tslint:disable:no-require-imports no-require-imports no-var-requires max-classes-per-file
const languageClientName = 'Python Tools';

@injectable()
Expand Down
1 change: 0 additions & 1 deletion src/client/activation/node/languageServerProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ export class NodeLanguageServerProxy implements ILanguageServerProxy {
}
}

// tslint:disable-next-line: no-empty
public loadExtension(_args?: {}) {}

@captureTelemetry(
Expand Down
6 changes: 3 additions & 3 deletions src/client/activation/none/activator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ export class NoLanguageServerExtensionActivator implements ILanguageServerActiva
this.proposePylancePopup.showBanner().ignoreErrors();
}
}
// tslint:disable-next-line: no-empty

public dispose(): void {}
// tslint:disable-next-line: no-empty

public activate(): void {}
// tslint:disable-next-line: no-empty

public deactivate(): void {}

public provideRenameEdits(
Expand Down
1 change: 0 additions & 1 deletion src/client/activation/serviceRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ import {
LanguageServerType,
} from './types';

// tslint:disable-next-line: max-func-body-length
export function registerTypes(serviceManager: IServiceManager, languageServerType: LanguageServerType) {
serviceManager.addSingleton<ILanguageServerCache>(ILanguageServerCache, LanguageServerExtensionActivationService);
serviceManager.addBinding(ILanguageServerCache, IExtensionActivationService);
Expand Down
1 change: 0 additions & 1 deletion src/client/activation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export enum LanguageServerType {
export const DotNetLanguageServerFolder = 'languageServer';
export const NodeLanguageServerFolder = 'nodeLanguageServer';

// tslint:disable-next-line: interface-name
export interface LanguageServerCommandHandler {
clearAnalysisCache(): void;
}
Expand Down
4 changes: 0 additions & 4 deletions src/client/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export interface IExtensionApi {
}

export function buildApi(
// tslint:disable-next-line:no-any
ready: Promise<any>,
serviceManager: IServiceManager,
serviceContainer: IServiceContainer,
Expand Down Expand Up @@ -142,7 +141,6 @@ export function buildApi(
// These are for backwards compatibility. Other extensions are using these APIs and we don't want
// to force them to move to the jupyter extension ... yet.
datascience: {
// tslint:disable:no-any
registerRemoteServerProvider: jupyterIntegration
? jupyterIntegration.registerRemoteServerProvider.bind(jupyterIntegration)
: (noop as any),
Expand All @@ -154,10 +152,8 @@ export function buildApi(

// In test environment return the DI Container.
if (isTestExecution()) {
// tslint:disable:no-any
(api as any).serviceContainer = serviceContainer;
(api as any).serviceManager = serviceManager;
// tslint:enable:no-any
}
return api;
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class InvalidPythonPathInDebuggerService extends BaseDiagnosticsService
}
public async validatePythonPath(pythonPath?: string, pythonPathSource?: PythonPathSource, resource?: Uri) {
pythonPath = pythonPath ? this.resolveVariables(pythonPath, resource) : undefined;
// tslint:disable-next-line:no-invalid-template-strings

if (pythonPath === '${command:python.interpreterPath}' || !pythonPath) {
pythonPath = this.configService.getSettings(resource).pythonPath;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export class InvalidMacPythonInterpreterService extends BaseDiagnosticsService {
}
public dispose() {
if (this.timeOut) {
// tslint:disable-next-line: no-any
clearTimeout(this.timeOut as any);
this.timeOut = undefined;
}
Expand Down Expand Up @@ -177,7 +176,6 @@ export class InvalidMacPythonInterpreterService extends BaseDiagnosticsService {
}
// Lets wait, for more changes, dirty simple throttling.
if (this.timeOut) {
// tslint:disable-next-line: no-any
clearTimeout(this.timeOut as any);
this.timeOut = undefined;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class PowerShellActivationHackDiagnosticsService extends BaseDiagnosticsS
const options = [
{
prompt: 'Use Command Prompt',
// tslint:disable-next-line:no-object-literal-type-assertion

command: {
diagnostic,
invoke: async (): Promise<void> => {
Expand Down
4 changes: 1 addition & 3 deletions src/client/common/application/applicationEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export class ApplicationEnvironment implements IApplicationEnvironment {
return vscode.env.machineId;
}
public get extensionName(): string {
// tslint:disable-next-line:non-literal-require
return this.packageJson.displayName;
}
/**
Expand All @@ -76,9 +75,8 @@ export class ApplicationEnvironment implements IApplicationEnvironment {
public get shell(): string {
return vscode.env.shell;
}
// tslint:disable-next-line:no-any

public get packageJson(): any {
// tslint:disable-next-line:non-literal-require no-require-imports
return require('../../../../package.json');
}
public get channel(): Channel {
Expand Down
2 changes: 0 additions & 2 deletions src/client/common/application/applicationShell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Licensed under the MIT License.
'use strict';

// tslint:disable:no-var-requires no-any unified-signatures

import { injectable } from 'inversify';
import {
CancellationToken,
Expand Down
2 changes: 0 additions & 2 deletions src/client/common/application/commandManager.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

// tslint:disable:no-any

import { inject, injectable } from 'inversify';
import { commands, Disposable, TextEditor, TextEditorEdit } from 'vscode';
import { ICommandNameArgumentTypeMapping } from './commands';
Expand Down
2 changes: 0 additions & 2 deletions src/client/common/application/customEditorService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export class CustomEditorService implements ICustomEditorService {
},
): vscode.Disposable {
if (this.useCustomEditorApi) {
// tslint:disable-next-line: no-any
return (vscode.window as any).registerCustomEditorProvider(viewType, provider, options);
} else {
return { dispose: noop };
Expand All @@ -46,7 +45,6 @@ export class CustomEditorService implements ICustomEditorService {
}
}

// tslint:disable-next-line: no-any
private async enableCustomEditors() {
// This code is temporary.
const settings = this.workspace.getConfiguration('workbench', undefined);
Expand Down
4 changes: 2 additions & 2 deletions src/client/common/application/debugService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ export class DebugService implements IDebugService {
public get onDidChangeBreakpoints(): Event<BreakpointsChangeEvent> {
return debug.onDidChangeBreakpoints;
}
// tslint:disable-next-line:no-any

public registerDebugConfigurationProvider(debugType: string, provider: any): Disposable {
return debug.registerDebugConfigurationProvider(debugType, provider);
}
// tslint:disable-next-line:no-any

public registerDebugAdapterTrackerFactory(debugType: string, provider: any): Disposable {
return debug.registerDebugAdapterTrackerFactory(debugType, provider);
}
Expand Down
2 changes: 0 additions & 2 deletions src/client/common/application/debugSessionTelemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { IDisposableRegistry } from '../types';
import { StopWatch } from '../utils/stopWatch';
import { IDebugService } from './types';

// tslint:disable-next-line no-any
function isResponse(a: any): a is DebugProtocol.Response {
return a.type === 'response';
}
Expand All @@ -32,7 +31,6 @@ class TelemetryTracker implements DebugAdapterTracker {
this.sendTelemetry(EventName.DEBUG_SESSION_START);
}

// tslint:disable-next-line no-any
public onDidSendMessage(message: any): void {
if (isResponse(message)) {
if (message.command === 'configurationDone') {
Expand Down
Loading

0 comments on commit c1a8d94

Please sign in to comment.