Skip to content

Commit 6fe711f

Browse files
authored
Remove unused eslint-disable directives (microsoft#52987)
1 parent 835fff8 commit 6fe711f

File tree

13 files changed

+9
-27
lines changed

13 files changed

+9
-27
lines changed

scripts/build/utils.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-restricted-globals */
2-
31
import { CancelError } from "@esfx/canceltoken";
42
import assert from "assert";
53
import chalk from "chalk";

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1633,7 +1633,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
16331633
// `structuralIsReused`, which would be a TDZ violation if it was not set in advance to `undefined`.
16341634
let structureIsReused: StructureIsReused;
16351635
tracing?.push(tracing.Phase.Program, "tryReuseStructureFromOldProgram", {});
1636-
structureIsReused = tryReuseStructureFromOldProgram(); // eslint-disable-line prefer-const
1636+
structureIsReused = tryReuseStructureFromOldProgram();
16371637
tracing?.pop();
16381638
if (structureIsReused !== StructureIsReused.Completely) {
16391639
processingDefaultLibFiles = [];

src/compiler/sourcemap.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export function createSourceMapGenerator(host: EmitHost, file: string, sourceRoo
103103
return sourceIndex;
104104
}
105105

106-
/* eslint-disable local/boolean-trivia, no-null/no-null */
106+
/* eslint-disable no-null/no-null */
107107
function setSourceContent(sourceIndex: number, content: string | null) {
108108
enter();
109109
if (content !== null) {
@@ -115,7 +115,7 @@ export function createSourceMapGenerator(host: EmitHost, file: string, sourceRoo
115115
}
116116
exit();
117117
}
118-
/* eslint-enable local/boolean-trivia, no-null/no-null */
118+
/* eslint-enable no-null/no-null */
119119

120120
function addName(name: string) {
121121
enter();

src/compiler/sys.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ export function getFileWatcherEventKind(oldTime: number, newTime: number) {
537537
/** @internal */
538538
export const ignoredPaths = ["/node_modules/.", "/.git", "/.#"];
539539

540-
let curSysLog: (s: string) => void = noop; // eslint-disable-line prefer-const
540+
let curSysLog: (s: string) => void = noop;
541541

542542
/** @internal */
543543
export function sysLog(s: string) {
@@ -1465,7 +1465,6 @@ export function getNodeMajorVersion(): number | undefined {
14651465
}
14661466

14671467
// TODO: GH#18217 this is used as if it's certainly defined in many places.
1468-
// eslint-disable-next-line prefer-const
14691468
export let sys: System = (() => {
14701469
// NodeJS detects "\uFEFF" at the start of the string and *replaces* it with the actual
14711470
// byte order mark from the specified encoding. Using any other byte order mark does

src/compiler/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4723,7 +4723,7 @@ export interface Program extends ScriptReferenceHost {
47234723
*/
47244724
emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult;
47254725
/** @internal */
4726-
emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnly?: boolean | EmitOnly, customTransformers?: CustomTransformers, forceDtsEmit?: boolean): EmitResult; // eslint-disable-line @typescript-eslint/unified-signatures
4726+
emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnly?: boolean | EmitOnly, customTransformers?: CustomTransformers, forceDtsEmit?: boolean): EmitResult;
47274727

47284728
getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
47294729
getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
@@ -5915,7 +5915,7 @@ export const enum InternalSymbolName {
59155915
* with a normal string (which is good, it cannot be misused on assignment or on usage),
59165916
* while still being comparable with a normal string via === (also good) and castable from a string.
59175917
*/
5918-
export type __String = (string & { __escapedIdentifier: void }) | (void & { __escapedIdentifier: void }) | InternalSymbolName; // eslint-disable-line @typescript-eslint/naming-convention
5918+
export type __String = (string & { __escapedIdentifier: void }) | (void & { __escapedIdentifier: void }) | InternalSymbolName;
59195919

59205920
/** ReadonlyMap where keys are `__String`s. */
59215921
export interface ReadonlyUnderscoreEscapedMap<T> extends ReadonlyMap<__String, T> {

src/compiler/utilities.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7936,7 +7936,6 @@ function SourceMapSource(this: SourceMapSource, fileName: string, text: string,
79367936
this.skipTrivia = skipTrivia || (pos => pos);
79377937
}
79387938

7939-
// eslint-disable-next-line prefer-const
79407939
/** @internal */
79417940
export const objectAllocator: ObjectAllocator = {
79427941
getNodeConstructor: () => Node as any,

src/compiler/visitorPublic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ export function visitEachChild<T extends Node>(node: T, visitor: Visitor, contex
601601
*/
602602
export function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined;
603603
/** @internal */
604-
export function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor, tokenVisitor?: Visitor, nodeVisitor?: NodeVisitor): T | undefined; // eslint-disable-line @typescript-eslint/unified-signatures
604+
export function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor, tokenVisitor?: Visitor, nodeVisitor?: NodeVisitor): T | undefined;
605605
export function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor = visitNodes, tokenVisitor?: Visitor, nodeVisitor: NodeVisitor = visitNode): T | undefined {
606606
if (node === undefined) {
607607
return undefined;

src/harness/harnessLanguageService.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -866,22 +866,18 @@ class SessionServerHost implements ts.server.ServerHost, ts.server.Logger {
866866
}
867867

868868
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any {
869-
// eslint-disable-next-line no-restricted-globals
870869
return setTimeout(callback, ms, ...args);
871870
}
872871

873872
clearTimeout(timeoutId: any): void {
874-
// eslint-disable-next-line no-restricted-globals
875873
clearTimeout(timeoutId);
876874
}
877875

878876
setImmediate(callback: (...args: any[]) => void, _ms: number, ...args: any[]): any {
879-
// eslint-disable-next-line no-restricted-globals
880877
return setImmediate(callback, args);
881878
}
882879

883880
clearImmediate(timeoutId: any): void {
884-
// eslint-disable-next-line no-restricted-globals
885881
clearImmediate(timeoutId);
886882
}
887883

src/harness/runnerbase.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ export type TestRunnerKind = CompilerTestKind | FourslashTestKind | "project" |
99
export type CompilerTestKind = "conformance" | "compiler";
1010
export type FourslashTestKind = "fourslash" | "fourslash-shims" | "fourslash-shims-pp" | "fourslash-server";
1111

12-
/* eslint-disable prefer-const */
1312
export let shards = 1;
1413
export let shardId = 1;
15-
/* eslint-enable prefer-const */
1614

1715
// The following have setters as while they're read here in the harness, they're only set in the runner
1816
export function setShards(count: number) {
@@ -65,4 +63,4 @@ export abstract class RunnerBase {
6563
fixedPath = fixedPath.replace(localHost, "");
6664
return fixedPath;
6765
}
68-
}
66+
}

src/services/organizeImports.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,7 @@ function compareModuleSpecifiersWorker(m1: Expression | undefined, m2: Expressio
600600
const name2 = m2 === undefined ? undefined : getExternalModuleName(m2);
601601
return compareBooleans(name1 === undefined, name2 === undefined) ||
602602
compareBooleans(isExternalModuleNameRelative(name1!), isExternalModuleNameRelative(name2!)) ||
603-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
604-
comparer(name1!, name2!); // I don't know why eslint is wrong but this one is necessary
603+
comparer(name1!, name2!);
605604
}
606605

607606
function getModuleSpecifierExpression(declaration: AnyImportOrRequireStatement): Expression | undefined {

src/services/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,10 +567,8 @@ export interface LanguageService {
567567
getSmartSelectionRange(fileName: string, position: number): SelectionRange;
568568

569569
/** @internal */
570-
// eslint-disable-next-line @typescript-eslint/unified-signatures
571570
getDefinitionAtPosition(fileName: string, position: number, searchOtherFilesOnly: false, stopAtAlias: boolean): readonly DefinitionInfo[] | undefined;
572571
/** @internal */
573-
// eslint-disable-next-line @typescript-eslint/unified-signatures
574572
getDefinitionAtPosition(fileName: string, position: number, searchOtherFilesOnly: boolean, stopAtAlias: false): readonly DefinitionInfo[] | undefined;
575573
getDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined;
576574
getDefinitionAndBoundSpan(fileName: string, position: number): DefinitionInfoAndBoundSpan | undefined;

src/testRunner/parallel/host.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,12 @@ export function start() {
318318
}
319319
case "timeout": {
320320
if (worker.timer) {
321-
// eslint-disable-next-line no-restricted-globals
322321
clearTimeout(worker.timer);
323322
}
324323
if (data.payload.duration === "reset") {
325324
worker.timer = undefined;
326325
}
327326
else {
328-
// eslint-disable-next-line no-restricted-globals
329327
worker.timer = setTimeout(killChild, data.payload.duration, data.payload);
330328
}
331329
break;
@@ -649,6 +647,5 @@ export function start() {
649647
shimNoopTestInterface(global);
650648
}
651649

652-
// eslint-disable-next-line no-restricted-globals
653650
setTimeout(() => startDelayed(perfData, totalCost), 0); // Do real startup on next tick, so all unit tests have been collected
654651
}

src/testRunner/unittests/services/preProcessFile.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ describe("unittests:: services:: PreProcessFile:", () => {
350350
});
351351

352352
it("Correctly returns empty importedFiles with incorrect template expression", () => {
353-
/* eslint-disable no-template-curly-in-string */
354353
test("const foo = `${",
355354
/*readImportFile*/ true,
356355
/*detectJavaScriptImports*/ true,
@@ -362,7 +361,6 @@ describe("unittests:: services:: PreProcessFile:", () => {
362361
ambientExternalModules: undefined,
363362
isLibFile: false
364363
});
365-
/* eslint-enable no-template-curly-in-string */
366364
});
367365

368366
it("Correctly return ES6 exports", () => {

0 commit comments

Comments
 (0)