Skip to content

Commit 2305c10

Browse files
author
Andy Hanson
committed
Fix lint errors
1 parent 230e1da commit 2305c10

26 files changed

+139
-226
lines changed

src/compiler/moduleNameResolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// <reference path="core.ts" />
1+
/// <reference path="core.ts" />
22
/// <reference path="diagnosticInformationMap.generated.ts" />
33

44
namespace ts {

src/compiler/program.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ namespace ts {
298298
let noDiagnosticsTypeChecker: TypeChecker;
299299
let classifiableNames: Map<string>;
300300

301-
let cachedSemanticDiagnosticsForFile: DiagnosticCache = {};
302-
let cachedDeclarationDiagnosticsForFile: DiagnosticCache = {};
301+
const cachedSemanticDiagnosticsForFile: DiagnosticCache = {};
302+
const cachedDeclarationDiagnosticsForFile: DiagnosticCache = {};
303303

304304
let resolvedTypeReferenceDirectives = createMap<ResolvedTypeReferenceDirective>();
305305
let fileProcessingDiagnostics = createDiagnosticCollection();
@@ -1105,7 +1105,7 @@ namespace ts {
11051105
return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedDeclarationDiagnosticsForFile, getDeclarationDiagnosticsForFileNoCache);
11061106
}
11071107

1108-
function getDeclarationDiagnosticsForFileNoCache(sourceFile: SourceFile| undefined, cancellationToken: CancellationToken) {
1108+
function getDeclarationDiagnosticsForFileNoCache(sourceFile: SourceFile | undefined, cancellationToken: CancellationToken) {
11091109
return runWithCancellationToken(() => {
11101110
const resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile, cancellationToken);
11111111
// Don't actually write any files since we're just getting diagnostics.

src/harness/fourslash.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -927,12 +927,11 @@ namespace FourSlash {
927927
this.assertObjectsEqual<ReferencesJson>(fullActual, fullExpected);
928928
}
929929

930-
function rangeToReferenceEntry(r: Range) {
931-
let { isWriteAccess, isDefinition, isInString } = (r.marker && r.marker.data) || { isWriteAccess: false, isDefinition: false, isInString: undefined };
932-
isWriteAccess = !!isWriteAccess; isDefinition = !!isDefinition;
933-
const result: any = { fileName: r.fileName, textSpan: { start: r.start, length: r.end - r.start }, isWriteAccess, isDefinition };
930+
function rangeToReferenceEntry(r: Range): ts.ReferenceEntry {
931+
const { isWriteAccess, isDefinition, isInString } = (r.marker && r.marker.data) || { isWriteAccess: false, isDefinition: false, isInString: undefined };
932+
const result: ts.ReferenceEntry = { fileName: r.fileName, textSpan: { start: r.start, length: r.end - r.start }, isWriteAccess: !!isWriteAccess, isDefinition: !!isDefinition };
934933
if (isInString !== undefined) {
935-
result.isInString = isInString;
934+
result.isInString = isInString
936935
}
937936
return result;
938937
}
@@ -2291,7 +2290,6 @@ namespace FourSlash {
22912290
else {
22922291
if (actual === undefined) {
22932292
this.raiseError(`${name} failed - expected the template {newText: "${expected.newText}", caretOffset: "${expected.caretOffset}"} but got nothing instead`);
2294-
22952293
}
22962294

22972295
if (actual.newText !== expected.newText) {

src/harness/unittests/services/formatting/getFormattingEditsForRange.ts

Lines changed: 0 additions & 88 deletions
This file was deleted.

src/harness/unittests/textChanges.ts

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
/// <reference path="..\..\services\textChanges.ts" />
33
/// <reference path="..\harness.ts" />
44

5+
// Some tests have trailing whitespace
6+
// tslint:disable trim-trailing-whitespace
7+
58
namespace ts {
69
describe("textChanges", () => {
710
function findChild(name: string, n: Node) {
@@ -572,7 +575,7 @@ import {
572575
} from "bar"`;
573576
runSingleFileTest("insertNodeInListAfter10", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
574577
changeTracker.insertNodeInListAfter(sourceFile, findChild("x", sourceFile), createImportSpecifier(createIdentifier("b"), createIdentifier("a")));
575-
})
578+
});
576579
}
577580
{
578581
const text = `
@@ -581,7 +584,7 @@ import {
581584
} from "bar"`;
582585
runSingleFileTest("insertNodeInListAfter11", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
583586
changeTracker.insertNodeInListAfter(sourceFile, findChild("x", sourceFile), createImportSpecifier(createIdentifier("b"), createIdentifier("a")));
584-
})
587+
});
585588
}
586589
{
587590
const text = `
@@ -590,7 +593,7 @@ import {
590593
} from "bar"`;
591594
runSingleFileTest("insertNodeInListAfter12", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
592595
changeTracker.insertNodeInListAfter(sourceFile, findChild("x", sourceFile), createImportSpecifier(undefined, createIdentifier("a")));
593-
})
596+
});
594597
}
595598
{
596599
const text = `
@@ -599,7 +602,7 @@ import {
599602
} from "bar"`;
600603
runSingleFileTest("insertNodeInListAfter13", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
601604
changeTracker.insertNodeInListAfter(sourceFile, findChild("x", sourceFile), createImportSpecifier(undefined, createIdentifier("a")));
602-
})
605+
});
603606
}
604607
{
605608
const text = `
@@ -609,7 +612,7 @@ import {
609612
} from "bar"`;
610613
runSingleFileTest("insertNodeInListAfter14", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
611614
changeTracker.insertNodeInListAfter(sourceFile, findChild("x", sourceFile), createImportSpecifier(createIdentifier("b"), createIdentifier("a")));
612-
})
615+
});
613616
}
614617
{
615618
const text = `
@@ -619,7 +622,7 @@ import {
619622
} from "bar"`;
620623
runSingleFileTest("insertNodeInListAfter15", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
621624
changeTracker.insertNodeInListAfter(sourceFile, findChild("x", sourceFile), createImportSpecifier(createIdentifier("b"), createIdentifier("a")));
622-
})
625+
});
623626
}
624627
{
625628
const text = `
@@ -629,7 +632,7 @@ import {
629632
} from "bar"`;
630633
runSingleFileTest("insertNodeInListAfter16", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
631634
changeTracker.insertNodeInListAfter(sourceFile, findChild("x", sourceFile), createImportSpecifier(undefined, createIdentifier("a")));
632-
})
635+
});
633636
}
634637
{
635638
const text = `
@@ -639,7 +642,7 @@ import {
639642
} from "bar"`;
640643
runSingleFileTest("insertNodeInListAfter17", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
641644
changeTracker.insertNodeInListAfter(sourceFile, findChild("x", sourceFile), createImportSpecifier(undefined, createIdentifier("a")));
642-
})
645+
});
643646
}
644647
{
645648
const text = `
@@ -648,15 +651,15 @@ import {
648651
} from "bar"`;
649652
runSingleFileTest("insertNodeInListAfter18", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
650653
changeTracker.insertNodeInListAfter(sourceFile, findChild("x", sourceFile), createImportSpecifier(undefined, createIdentifier("a")));
651-
})
654+
});
652655
}
653656
{
654657
const text = `
655658
class A {
656659
x;
657660
}`;
658661
runSingleFileTest("insertNodeAfterMultipleNodes", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
659-
let newNodes = [];
662+
const newNodes = [];
660663
for (let i = 0; i < 11 /*error doesn't occur with fewer nodes*/; ++i) {
661664
newNodes.push(
662665
createProperty(undefined, undefined, i + "", undefined, undefined, undefined));
@@ -714,7 +717,7 @@ class A {
714717
class A {
715718
x = foo
716719
}
717-
`
720+
`;
718721
runSingleFileTest("insertNodeInClassAfterNodeWithoutSeparator1", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
719722
const newNode = createProperty(
720723
/*decorators*/ undefined,
@@ -732,7 +735,7 @@ class A {
732735
x() {
733736
}
734737
}
735-
`
738+
`;
736739
runSingleFileTest("insertNodeInClassAfterNodeWithoutSeparator2", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
737740
const newNode = createProperty(
738741
/*decorators*/ undefined,
@@ -749,7 +752,7 @@ class A {
749752
interface A {
750753
x
751754
}
752-
`
755+
`;
753756
runSingleFileTest("insertNodeInInterfaceAfterNodeWithoutSeparator1", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
754757
const newNode = createProperty(
755758
/*decorators*/ undefined,
@@ -766,7 +769,7 @@ interface A {
766769
interface A {
767770
x()
768771
}
769-
`
772+
`;
770773
runSingleFileTest("insertNodeInInterfaceAfterNodeWithoutSeparator2", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
771774
const newNode = createProperty(
772775
/*decorators*/ undefined,
@@ -781,7 +784,7 @@ interface A {
781784
{
782785
const text = `
783786
let x = foo
784-
`
787+
`;
785788
runSingleFileTest("insertNodeInStatementListAfterNodeWithoutSeparator1", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
786789
const newNode = createStatement(createParen(createLiteral(1)));
787790
changeTracker.insertNodeAfter(sourceFile, findVariableStatementContaining("x", sourceFile), newNode, { suffix: newLineCharacter });

src/lib/dom.iterable.d.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ interface DOMTokenList {
55
}
66

77
interface NodeList {
8-
9-
10-
/**
8+
/**
119
* Returns an array of key, value pairs for every entry in the list
1210
*/
1311
entries(): IterableIterator<[number, Node]>;
@@ -17,23 +15,23 @@ interface NodeList {
1715
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
1816
*/
1917
forEach(callbackfn: (value: Node, index: number, listObj: NodeList) => void, thisArg?: any): void;
20-
/**
18+
/**
2119
* Returns an list of keys in the list
2220
*/
2321
keys(): IterableIterator<number>;
2422

25-
/**
23+
/**
2624
* Returns an list of values in the list
2725
*/
2826
values(): IterableIterator<Node>;
29-
3027

31-
[Symbol.iterator](): IterableIterator<Node>
28+
29+
[Symbol.iterator](): IterableIterator<Node>;
3230
}
3331

3432
interface NodeListOf<TNode extends Node> {
3533

36-
/**
34+
/**
3735
* Returns an array of key, value pairs for every entry in the list
3836
*/
3937
entries(): IterableIterator<[number, TNode]>;
@@ -44,14 +42,14 @@ interface NodeListOf<TNode extends Node> {
4442
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
4543
*/
4644
forEach(callbackfn: (value: TNode, index: number, listObj: NodeListOf<TNode>) => void, thisArg?: any): void;
47-
/**
45+
/**
4846
* Returns an list of keys in the list
4947
*/
5048
keys(): IterableIterator<number>;
51-
/**
49+
/**
5250
* Returns an list of values in the list
5351
*/
54-
values(): IterableIterator<TNode>;
55-
56-
[Symbol.iterator](): IterableIterator<TNode>
52+
values(): IterableIterator<TNode>;
53+
54+
[Symbol.iterator](): IterableIterator<TNode>;
5755
}

src/lib/es2015.collection.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ declare var Map: MapConstructor;
1717

1818
interface ReadonlyMap<K, V> {
1919
forEach(callbackfn: (value: V, key: K, map: ReadonlyMap<K, V>) => void, thisArg?: any): void;
20-
get(key: K): V|undefined;
20+
get(key: K): V | undefined;
2121
has(key: K): boolean;
2222
readonly size: number;
2323
}

src/lib/es2015.core.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ interface Object {
268268
* Determines whether an object has a property with the specified name.
269269
* @param v A property name.
270270
*/
271-
hasOwnProperty(v: PropertyKey): boolean
271+
hasOwnProperty(v: PropertyKey): boolean;
272272

273273
/**
274274
* Determines whether a specified property is enumerable.
@@ -486,10 +486,10 @@ interface String {
486486
bold(): string;
487487

488488
/** Returns a <tt> HTML element */
489-
fixed(): string
489+
fixed(): string;
490490

491491
/** Returns a <font> HTML element and sets the color attribute value */
492-
fontcolor(color: string): string
492+
fontcolor(color: string): string;
493493

494494
/** Returns a <font> HTML element and sets the size attribute value */
495495
fontsize(size: number): string;

src/lib/es2015.iterable.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ interface IArguments {
9191
}
9292

9393
interface Map<K, V> {
94-
[Symbol.iterator](): IterableIterator<[K,V]>;
94+
[Symbol.iterator](): IterableIterator<[K, V]>;
9595
entries(): IterableIterator<[K, V]>;
9696
keys(): IterableIterator<K>;
9797
values(): IterableIterator<V>;

src/lib/es2015.proxy.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ interface ProxyHandler<T> {
1212
enumerate? (target: T): PropertyKey[];
1313
ownKeys? (target: T): PropertyKey[];
1414
apply? (target: T, thisArg: any, argArray?: any): any;
15-
construct? (target: T, argArray: any, newTarget?: any): object
15+
construct? (target: T, argArray: any, newTarget?: any): object;
1616
}
1717

1818
interface ProxyConstructor {
1919
revocable<T>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };
20-
new <T>(target: T, handler: ProxyHandler<T>): T
20+
new <T>(target: T, handler: ProxyHandler<T>): T;
2121
}
2222
declare var Proxy: ProxyConstructor;

0 commit comments

Comments
 (0)