Skip to content

Commit

Permalink
Fixed new linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckton committed Jan 5, 2016
1 parent cde12ef commit c1205eb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ namespace ts {
function hasFileWithHigherPriorityExtension(file: string, literalFiles: Map<string>, wildcardFiles: Map<string>, extensions: string[], keyMapper: (value: string) => string) {
const extensionPriority = getExtensionPriority(file, extensions);
const adjustedExtensionPriority = adjustExtensionPriority(extensionPriority);
for (let i = ExtensionPriority.Highest; i < adjustedExtensionPriority; ++i) {
for (let i = ExtensionPriority.Highest; i < adjustedExtensionPriority; i++) {
const higherPriorityExtension = extensions[i];
const higherPriorityPath = keyMapper(changeExtension(file, higherPriorityExtension));
if (hasProperty(literalFiles, higherPriorityPath) || hasProperty(wildcardFiles, higherPriorityPath)) {
Expand All @@ -838,7 +838,7 @@ namespace ts {
function removeWildcardFilesWithLowerPriorityExtension(file: string, wildcardFiles: Map<string>, extensions: string[], keyMapper: (value: string) => string) {
const extensionPriority = getExtensionPriority(file, extensions);
const nextExtensionPriority = getNextLowestExtensionPriority(extensionPriority);
for (let i = nextExtensionPriority; i < extensions.length; ++i) {
for (let i = nextExtensionPriority; i < extensions.length; i++) {
const lowerPriorityExtension = extensions[i];
const lowerPriorityPath = keyMapper(changeExtension(file, lowerPriorityExtension));
delete wildcardFiles[lowerPriorityPath];
Expand Down
10 changes: 5 additions & 5 deletions src/compiler/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ namespace ts {
}

export function indexOfAnyCharCode(text: string, charCodes: number[], start?: number): number {
for (let i = start || 0, len = text.length; i < len; ++i) {
for (let i = start || 0, len = text.length; i < len; i++) {
if (contains(charCodes, text.charCodeAt(i))) {
return i;
}
Expand Down Expand Up @@ -824,7 +824,7 @@ namespace ts {
const aComponents = getNormalizedPathComponents(a, currentDirectory);
const bComponents = getNormalizedPathComponents(b, currentDirectory);
const sharedLength = Math.min(aComponents.length, bComponents.length);
for (let i = 0; i < sharedLength; ++i) {
for (let i = 0; i < sharedLength; i++) {
const result = compareStrings(aComponents[i], bComponents[i], ignoreCase);
if (result !== Comparison.EqualTo) {
return result;
Expand All @@ -846,7 +846,7 @@ namespace ts {
return false;
}

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

// Iterate over each include base path and include unique base paths that are not a
// subpath of an existing base path
include: for (let i = 0; i < includeBasePaths.length; ++i) {
include: for (let i = 0; i < includeBasePaths.length; i++) {
const includeBasePath = includeBasePaths[i];
for (let j = 0; j < basePaths.length; ++j) {
for (let j = 0; j < basePaths.length; j++) {
if (containsPath(basePaths[j], includeBasePath, path, !useCaseSensitiveFileNames)) {
continue include;
}
Expand Down
10 changes: 1 addition & 9 deletions src/compiler/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,6 @@ namespace ts {
}
}

function getCanonicalPath(path: string): string {
return path.toLowerCase();
}

function getNames(collection: any): string[] {
const result: string[] = [];
for (let e = new Enumerator(collection); !e.atEnd(); e.moveNext()) {
Expand Down Expand Up @@ -357,10 +353,6 @@ namespace ts {
}
}

function getCanonicalPath(path: string): string {
return useCaseSensitiveFileNames ? path.toLowerCase() : path;
}

function getAccessibleFileSystemEntries(path: string): FileSystemEntries {
try {
const entries = _fs.readdirSync(path || ".").sort();
Expand Down Expand Up @@ -501,4 +493,4 @@ namespace ts {
return undefined; // Unsupported host
}
})();
}
}
4 changes: 0 additions & 4 deletions src/harness/projectsRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,6 @@ class ProjectRunner extends RunnerBase {
return Harness.IO.fileExists(getFileNameInTheProjectTest(fileName));
}

function directoryExists(directoryName: string): boolean {
return Harness.IO.directoryExists(getFileNameInTheProjectTest(directoryName));
}

function getSourceFileText(fileName: string): string {
let text: string = undefined;
try {
Expand Down

0 comments on commit c1205eb

Please sign in to comment.