Skip to content

Commit c1205eb

Browse files
committed
Fixed new linter warnings
1 parent cde12ef commit c1205eb

File tree

4 files changed

+8
-20
lines changed

4 files changed

+8
-20
lines changed

src/compiler/commandLineParser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ namespace ts {
816816
function hasFileWithHigherPriorityExtension(file: string, literalFiles: Map<string>, wildcardFiles: Map<string>, extensions: string[], keyMapper: (value: string) => string) {
817817
const extensionPriority = getExtensionPriority(file, extensions);
818818
const adjustedExtensionPriority = adjustExtensionPriority(extensionPriority);
819-
for (let i = ExtensionPriority.Highest; i < adjustedExtensionPriority; ++i) {
819+
for (let i = ExtensionPriority.Highest; i < adjustedExtensionPriority; i++) {
820820
const higherPriorityExtension = extensions[i];
821821
const higherPriorityPath = keyMapper(changeExtension(file, higherPriorityExtension));
822822
if (hasProperty(literalFiles, higherPriorityPath) || hasProperty(wildcardFiles, higherPriorityPath)) {
@@ -838,7 +838,7 @@ namespace ts {
838838
function removeWildcardFilesWithLowerPriorityExtension(file: string, wildcardFiles: Map<string>, extensions: string[], keyMapper: (value: string) => string) {
839839
const extensionPriority = getExtensionPriority(file, extensions);
840840
const nextExtensionPriority = getNextLowestExtensionPriority(extensionPriority);
841-
for (let i = nextExtensionPriority; i < extensions.length; ++i) {
841+
for (let i = nextExtensionPriority; i < extensions.length; i++) {
842842
const lowerPriorityExtension = extensions[i];
843843
const lowerPriorityPath = keyMapper(changeExtension(file, lowerPriorityExtension));
844844
delete wildcardFiles[lowerPriorityPath];

src/compiler/core.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ namespace ts {
116116
}
117117

118118
export function indexOfAnyCharCode(text: string, charCodes: number[], start?: number): number {
119-
for (let i = start || 0, len = text.length; i < len; ++i) {
119+
for (let i = start || 0, len = text.length; i < len; i++) {
120120
if (contains(charCodes, text.charCodeAt(i))) {
121121
return i;
122122
}
@@ -824,7 +824,7 @@ namespace ts {
824824
const aComponents = getNormalizedPathComponents(a, currentDirectory);
825825
const bComponents = getNormalizedPathComponents(b, currentDirectory);
826826
const sharedLength = Math.min(aComponents.length, bComponents.length);
827-
for (let i = 0; i < sharedLength; ++i) {
827+
for (let i = 0; i < sharedLength; i++) {
828828
const result = compareStrings(aComponents[i], bComponents[i], ignoreCase);
829829
if (result !== Comparison.EqualTo) {
830830
return result;
@@ -846,7 +846,7 @@ namespace ts {
846846
return false;
847847
}
848848

849-
for (let i = 0; i < parentComponents.length; ++i) {
849+
for (let i = 0; i < parentComponents.length; i++) {
850850
const result = compareStrings(parentComponents[i], childComponents[i], ignoreCase);
851851
if (result !== Comparison.EqualTo) {
852852
return false;
@@ -1021,9 +1021,9 @@ namespace ts {
10211021

10221022
// Iterate over each include base path and include unique base paths that are not a
10231023
// subpath of an existing base path
1024-
include: for (let i = 0; i < includeBasePaths.length; ++i) {
1024+
include: for (let i = 0; i < includeBasePaths.length; i++) {
10251025
const includeBasePath = includeBasePaths[i];
1026-
for (let j = 0; j < basePaths.length; ++j) {
1026+
for (let j = 0; j < basePaths.length; j++) {
10271027
if (containsPath(basePaths[j], includeBasePath, path, !useCaseSensitiveFileNames)) {
10281028
continue include;
10291029
}

src/compiler/sys.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ namespace ts {
139139
}
140140
}
141141

142-
function getCanonicalPath(path: string): string {
143-
return path.toLowerCase();
144-
}
145-
146142
function getNames(collection: any): string[] {
147143
const result: string[] = [];
148144
for (let e = new Enumerator(collection); !e.atEnd(); e.moveNext()) {
@@ -357,10 +353,6 @@ namespace ts {
357353
}
358354
}
359355

360-
function getCanonicalPath(path: string): string {
361-
return useCaseSensitiveFileNames ? path.toLowerCase() : path;
362-
}
363-
364356
function getAccessibleFileSystemEntries(path: string): FileSystemEntries {
365357
try {
366358
const entries = _fs.readdirSync(path || ".").sort();
@@ -501,4 +493,4 @@ namespace ts {
501493
return undefined; // Unsupported host
502494
}
503495
})();
504-
}
496+
}

src/harness/projectsRunner.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,6 @@ class ProjectRunner extends RunnerBase {
287287
return Harness.IO.fileExists(getFileNameInTheProjectTest(fileName));
288288
}
289289

290-
function directoryExists(directoryName: string): boolean {
291-
return Harness.IO.directoryExists(getFileNameInTheProjectTest(directoryName));
292-
}
293-
294290
function getSourceFileText(fileName: string): string {
295291
let text: string = undefined;
296292
try {

0 commit comments

Comments
 (0)