From 84fc29f9005f969f84480e3d142a88087d6b9f71 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 9 Feb 2017 12:46:09 -0800 Subject: [PATCH] Fix lint failures detected by tslint@4.4.2 --- src/compiler/sys.ts | 2 +- src/harness/fourslash.ts | 2 +- src/harness/harnessLanguageService.ts | 4 ++-- src/harness/unittests/tsserverProjectSystem.ts | 2 +- src/server/cancellationToken/cancellationToken.ts | 2 +- src/services/codefixes/unusedIdentifierFixes.ts | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 8ac797507b..c90a3484a8 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -486,7 +486,7 @@ namespace ts { // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) let options: any; if (!directoryExists(directoryName) || (isUNCPath(directoryName) && process.platform === "win32")) { - // do nothing if either + // do nothing if either // - target folder does not exist // - this is UNC path on Windows (https://github.com/Microsoft/TypeScript/issues/13874) return noOpFileWatcher; diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index c7f455bd75..fc85fb7276 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -183,7 +183,7 @@ namespace FourSlash { // The current caret position in the active file public currentCaretPosition = 0; - public lastKnownMarker: string = ""; + public lastKnownMarker = ""; // The file that's currently 'opened' public activeFile: FourSlashFile; diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index cd44fbf7a3..59930fd98b 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -5,7 +5,7 @@ namespace Harness.LanguageService { export class ScriptInfo { - public version: number = 1; + public version = 1; public editRanges: { length: number; textChangeRange: ts.TextChangeRange; }[] = []; private lineMap: number[] = undefined; @@ -594,7 +594,7 @@ namespace Harness.LanguageService { class SessionServerHost implements ts.server.ServerHost, ts.server.Logger { args: string[] = []; newLine: string; - useCaseSensitiveFileNames: boolean = false; + useCaseSensitiveFileNames = false; constructor(private host: NativeLanguageServiceHost) { this.newLine = this.host.getNewLine(); diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 93027675bd..e6f4abde38 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -3115,7 +3115,7 @@ namespace ts.projectSystem { let options = project.getCompilerOptions(); assert.isTrue(options.maxNodeModuleJsDepth === 2); - // Assert the option sticks + // Assert the option sticks projectService.setCompilerOptionsForInferredProjects({ target: ScriptTarget.ES2016 }); project = projectService.inferredProjects[0]; options = project.getCompilerOptions(); diff --git a/src/server/cancellationToken/cancellationToken.ts b/src/server/cancellationToken/cancellationToken.ts index 6d3dec67cc..de59f3a1bc 100644 --- a/src/server/cancellationToken/cancellationToken.ts +++ b/src/server/cancellationToken/cancellationToken.ts @@ -1,7 +1,7 @@ /// -// TODO: extract services types +// TODO: extract services types interface HostCancellationToken { isCancellationRequested(): boolean; } diff --git a/src/services/codefixes/unusedIdentifierFixes.ts b/src/services/codefixes/unusedIdentifierFixes.ts index 0ca01a81eb..6c0bc04eca 100644 --- a/src/services/codefixes/unusedIdentifierFixes.ts +++ b/src/services/codefixes/unusedIdentifierFixes.ts @@ -94,9 +94,9 @@ namespace ts.codefix { return removeSingleItem(namedImports.elements, token); } - // handle case where "import d, * as ns from './file'" + // handle case where "import d, * as ns from './file'" // or "'import {a, b as ns} from './file'" - case SyntaxKind.ImportClause: // this covers both 'import |d|' and 'import |d,| *' + case SyntaxKind.ImportClause: // this covers both 'import |d|' and 'import |d,| *' const importClause = token.parent; if (!importClause.namedBindings) { // |import d from './file'| or |import * as ns from './file'| const importDecl = findImportDeclaration(importClause);