Skip to content

Commit f0ad996

Browse files
authored
Remove TSLint-related comments (#17830)
* Remove tslint comments * News file * Update news file
1 parent e005a70 commit f0ad996

File tree

16 files changed

+3
-33
lines changed

16 files changed

+3
-33
lines changed

news/3 Code Health/4060.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove TSLint comments since we use ESLint.

src/client/common/utils/version.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,14 +391,12 @@ export function areSimilarVersions<T extends BasicVersionInfo, V extends BasicVe
391391
return false;
392392
}
393393

394-
// tslint:disable:no-any
395394
if (result < 0) {
396395
// eslint-disable-next-line @typescript-eslint/no-explicit-any
397396
return ((right as unknown) as any)[prop] === -1;
398397
}
399398
// eslint-disable-next-line @typescript-eslint/no-explicit-any
400399
return ((left as unknown) as any)[prop] === -1;
401-
// tslint:enable:no-any
402400
}
403401

404402
// semver

src/client/common/variables/systemVariables.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import { IDocumentManager, IWorkspaceService } from '../application/types';
1010
import * as Types from '../utils/sysTypes';
1111
import { IStringDictionary, ISystemVariables } from './types';
1212

13-
/* tslint:disable:rule1 no-any no-unnecessary-callback-wrapper jsdoc-format no-for-in prefer-const no-increment-decrement */
14-
1513
abstract class AbstractSystemVariables implements ISystemVariables {
1614
public resolve(value: string): string;
1715
public resolve(value: string[]): string[];

src/client/pythonEnvironments/base/locators/lowLevel/filesLocator.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
// tslint:disable-next-line:no-single-line-block-comment
54
/* eslint-disable max-classes-per-file */
65

76
import { Event } from 'vscode';

src/client/pythonEnvironments/base/locators/lowLevel/windowsKnownPathsLocator.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
// tslint:disable-next-line:no-single-line-block-comment
54
/* eslint-disable max-classes-per-file */
65

76
import { Event } from 'vscode';

src/test/activation/languageServer/languageClientFactory.unit.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
'use strict';
55

6-
//tslint:disable:no-require-imports no-require-imports no-var-requires no-any no-unnecessary-class max-func-body-length match-default-export-name
7-
86
import { expect } from 'chai';
97
import * as path from 'path';
108
import rewiremock from 'rewiremock';

src/test/activation/languageServer/languageServer.unit.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import '../../../client/common/extensions';
1616
import { IConfigurationService, IDisposable, IPythonSettings } from '../../../client/common/types';
1717
import { sleep } from '../../../client/common/utils/async';
1818

19-
//tslint:disable:no-require-imports no-require-imports no-var-requires no-any no-unnecessary-class max-func-body-length
20-
2119
suite('Language Server - LanguageServer', () => {
2220
let clientFactory: ILanguageClientFactory;
2321
let server: DotNetLanguageServerProxy;

src/test/common/extensions.unit.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ suite('String Extensions', () => {
7373
expect(formatString.format('one', 'two', 'three')).to.be.equal(expectedString);
7474
});
7575
test('String should remove quotes', () => {
76-
//tslint:disable:no-multiline-string
7776
const quotedString = `'foo is "bar" is foo' is bar'`;
7877
const quotedString2 = `foo is "bar" is foo' is bar'`;
7978
const quotedString3 = `foo is "bar" is foo' is bar`;
@@ -85,7 +84,6 @@ suite('String Extensions', () => {
8584
expect(quotedString4.trimQuotes()).to.be.equal(expectedString);
8685
});
8786
test('String should replace all substrings with new substring', () => {
88-
//tslint:disable:no-multiline-string
8987
const oldString = `foo \\ foo \\ foo`;
9088
const expectedString = `foo \\\\ foo \\\\ foo`;
9189
const oldString2 = `\\ foo \\ foo`;

src/test/common/platform/filesystem.unit.test.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ function Uri(filename: string): vscode.Uri {
2424
}
2525

2626
function createDummyStat(filetype: FileType): FileStat {
27-
//tslint:disable-next-line:no-any
2827
return { type: filetype } as any;
2928
}
3029

@@ -91,7 +90,6 @@ suite('Raw FileSystem', () => {
9190
const stat = TypeMoq.Mock.ofType<fsextra.Stats>(undefined, TypeMoq.MockBehavior.Strict);
9291
// This is necessary because passing "mock.object" to
9392
// Promise.resolve() triggers the lookup.
94-
//tslint:disable-next-line:no-any
9593
stat.setup((s: any) => s.then)
9694
.returns(() => undefined)
9795
.verifiable(TypeMoq.Times.atLeast(0));
@@ -174,7 +172,6 @@ suite('Raw FileSystem', () => {
174172
size: 10,
175173
ctime: 101,
176174
mtime: 102,
177-
//tslint:disable-next-line:no-any
178175
} as any;
179176
const old = createMockLegacyStat();
180177
setupStatFileType(old, testData.filetype);
@@ -687,7 +684,6 @@ suite('Raw FileSystem', () => {
687684
size: 10,
688685
ctime: 101,
689686
mtime: 102,
690-
//tslint:disable-next-line:no-any
691687
} as any;
692688
const lstat = createMockLegacyStat();
693689
setupStatFileType(lstat, FileType.Unknown);
@@ -712,7 +708,6 @@ suite('Raw FileSystem', () => {
712708
size: 10,
713709
ctime: 101,
714710
mtime: 102,
715-
//tslint:disable-next-line:no-any
716711
} as any;
717712
const lstat = createMockLegacyStat();
718713
lstat
@@ -742,7 +737,6 @@ suite('Raw FileSystem', () => {
742737
size: 10,
743738
ctime: 101,
744739
mtime: 102,
745-
//tslint:disable-next-line:no-any
746740
} as any;
747741
const lstat = createMockLegacyStat();
748742
lstat
@@ -800,7 +794,6 @@ suite('Raw FileSystem', () => {
800794
suite('createReadStream', () => {
801795
test('wraps the low-level function', () => {
802796
const filename = 'x/y/z/spam.py';
803-
//tslint:disable-next-line:no-any
804797
const expected = {} as any;
805798
raw.setup((r) => r.createReadStream(filename)) // expect the specific filename
806799
.returns(() => expected);
@@ -824,7 +817,6 @@ suite('Raw FileSystem', () => {
824817
suite('createWriteStream', () => {
825818
test('wraps the low-level function', () => {
826819
const filename = 'x/y/z/spam.py';
827-
//tslint:disable-next-line:no-any
828820
const expected = {} as any;
829821
raw.setup((r) => r.createWriteStream(filename)) // expect the specific filename
830822
.returns(() => expected);
@@ -880,7 +872,6 @@ suite('FileSystemUtils', () => {
880872
const stat = TypeMoq.Mock.ofType<FileStat>(undefined, TypeMoq.MockBehavior.Strict);
881873
// This is necessary because passing "mock.object" to
882874
// Promise.resolve() triggers the lookup.
883-
//tslint:disable-next-line:no-any
884875
stat.setup((s: any) => s.then)
885876
.returns(() => undefined)
886877
.verifiable(TypeMoq.Times.atLeast(0));

src/test/linters/lint.functional.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ function getMessages(product: Product): ILintMessage[] {
587587
}
588588
default: {
589589
throwUnknownProduct(product);
590-
return []; // to quiet tslint
590+
return [];
591591
}
592592
}
593593
}

src/test/linters/lint.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ class TestFixture extends BaseTestFixture {
591591
}
592592
default: {
593593
throwUnknownProduct(product);
594-
return []; // to quiet tslint
594+
return [];
595595
}
596596
}
597597
this.setMessages(messages, product);

src/test/mocks/vsc/charCode.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* Licensed under the MIT License. See License.txt in the project root for license information.
55
*--------------------------------------------------------------------------------------------*/
66

7-
/* tslint:disable */
8-
97
// Names from https://blog.codinghorror.com/ascii-pronunciation-rules-for-programmers/
108

119
/**

src/test/mocks/vsc/uri.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
'use strict';
88

9-
/* tslint:disable */
10-
119
import * as pathImport from 'path';
1210
import { CharCode } from './charCode';
1311

src/test/pythonEnvironments/discovery/locators/windowsKnownPathsLocator.functional.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,12 @@ suite('Python envs locator - WindowsPathEnvVarLocator', async () => {
6969
suiteSetup(async function () {
7070
if (!IS_WINDOWS) {
7171
if (!process.env.PVSC_TEST_FORCE) {
72-
// tslint:disable-next-line:no-invalid-this
7372
this.skip();
7473
}
75-
// tslint:disable:no-require-imports
7674
// eslint-disable-next-line global-require
7775
const sinon = require('sinon');
7876
// eslint-disable-next-line global-require
7977
const platformAPI = require('../../../../../client/common/utils/platform');
80-
// tslint:enable:no-require-imports
8178
const stub = sinon.stub(platformAPI, 'getOSType');
8279
stub.returns(OSType.Windows);
8380
}
@@ -97,7 +94,6 @@ suite('Python envs locator - WindowsPathEnvVarLocator', async () => {
9794
try {
9895
run();
9996
} catch (err) {
100-
// tslint:disable-next-line:no-console
10197
console.log(err);
10298
}
10399
});

src/test/telemetry/index.unit.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT License.
33
'use strict';
44

5-
//tslint:disable:max-func-body-length match-default-export-name no-any
65
import { expect } from 'chai';
76
import rewiremock from 'rewiremock';
87
import * as TypeMoq from 'typemoq';

src/test/utils/fs.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ export async function ensureFSTree(
283283
throw Error(`unsupported file kind ${kind}`);
284284
}
285285
} catch (err) {
286-
// tslint:disable-next-line:no-console
287286
console.log('FAILED:', err);
288287
throw err;
289288
}

0 commit comments

Comments
 (0)