From c51cdbdf8fdbc4a26b48538e6bec4addea5646c6 Mon Sep 17 00:00:00 2001 From: Erich Gamma Date: Tue, 30 Jan 2018 10:35:31 +0100 Subject: [PATCH 1/7] experiment with unused variables --- .vscode/launch.json | 2 +- build/gulpfile.hygiene.js | 20 ++++++++++++-------- tslint.json | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 62a36372ccdd7..5e4670ba0e38a 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,7 +9,7 @@ "program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js", "stopOnEntry": true, "args": [ - "watch-extension:json-client" + "hygiene" ], "cwd": "${workspaceFolder}" }, diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index d6402600d27c5..ff7ebc944cd7f 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -119,8 +119,8 @@ const eslintFilter = [ const tslintFilter = [ 'src/**/*.ts', - 'test/**/*.ts', - 'extensions/**/*.ts', + //'test/**/*.ts', + //'extensions/**/*.ts', '!**/fixtures/**', '!**/typings/**', '!**/node_modules/**', @@ -227,15 +227,19 @@ const hygiene = exports.hygiene = (some, options) => { const tsl = es.through(function (file) { const configuration = tslint.Configuration.findConfiguration(null, '.'); + const program = tslint.Linter.createProgram("tsconfig.json", "src/"); const options = { formatter: 'json', rulesDirectory: 'build/lib/tslint' }; const contents = file.contents.toString('utf8'); - const linter = new tslint.Linter(options); - linter.lint(file.relative, contents, configuration.results); - const result = linter.getResult(); + const linter = new tslint.Linter(options, program); + if (file.relative.startsWith('src')) { - if (result.failures.length > 0) { - reportFailures(result.failures); - errorCount += result.failures.length; + linter.lint(file.relative, contents, configuration.results); + const result = linter.getResult(); + + if (result.failures.length > 0) { + reportFailures(result.failures); + errorCount += result.failures.length; + } } this.emit('data', file); diff --git a/tslint.json b/tslint.json index 24a7ac86d1b30..e79f8b5114e60 100644 --- a/tslint.json +++ b/tslint.json @@ -6,7 +6,7 @@ "no-string-throw": true, "no-unused-expression": true, "no-duplicate-variable": true, - // "no-unused-variable": true, // requires type information in tslint > v4 + "no-unused-variable": true, // requires type information in tslint > v4 "curly": true, "class-name": true, "semicolon": [ From c7b7ace3d430c1acf8e87037d5e8a808649722a0 Mon Sep 17 00:00:00 2001 From: Erich Gamma Date: Fri, 2 Feb 2018 16:11:16 +0100 Subject: [PATCH 2/7] Perform the tslint checks in the context of a program to enable checks which require type information --- build/gulpfile.hygiene.js | 28 +++++++++++++--------------- package.json | 2 +- tslint.json | 2 +- yarn.lock | 25 +++++++++++++++++-------- 4 files changed, 32 insertions(+), 25 deletions(-) diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index ff7ebc944cd7f..bea0169ce44ae 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -225,23 +225,14 @@ const hygiene = exports.hygiene = (some, options) => { }); } + const program = tslint.Linter.createProgram("src/tsconfig.json"); + const configuration = tslint.Configuration.findConfiguration('tslint.json', '.'); + const tslintOptions = { formatter: 'json', rulesDirectory: 'build/lib/tslint' }; + const linter = new tslint.Linter(tslintOptions, program); + const tsl = es.through(function (file) { - const configuration = tslint.Configuration.findConfiguration(null, '.'); - const program = tslint.Linter.createProgram("tsconfig.json", "src/"); - const options = { formatter: 'json', rulesDirectory: 'build/lib/tslint' }; const contents = file.contents.toString('utf8'); - const linter = new tslint.Linter(options, program); - if (file.relative.startsWith('src')) { - - linter.lint(file.relative, contents, configuration.results); - const result = linter.getResult(); - - if (result.failures.length > 0) { - reportFailures(result.failures); - errorCount += result.failures.length; - } - } - + linter.lint(file.relative, contents, configuration.results); this.emit('data', file); }); @@ -275,6 +266,13 @@ const hygiene = exports.hygiene = (some, options) => { this.emit('data', data); }, function () { process.stdout.write('\n'); + + const tslintResult = linter.getResult(); + if (tslintResult.failures.length > 0) { + reportFailures(tslintResult.failures); + errorCount += tslintResult.failures.length; + } + if (errorCount > 0) { this.emit('error', 'Hygiene failed with ' + errorCount + ' errors. Check \'build/gulpfile.hygiene.js\'.'); } else { diff --git a/package.json b/package.json index 51176c67d9333..3025beb449d50 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "rimraf": "^2.2.8", "sinon": "^1.17.2", "source-map": "^0.4.4", - "tslint": "^5.8.0", + "tslint": "^5.9.1", "typescript": "2.6.1", "typescript-formatter": "4.0.1", "uglify-es": "^3.0.18", diff --git a/tslint.json b/tslint.json index e79f8b5114e60..12d553ae18016 100644 --- a/tslint.json +++ b/tslint.json @@ -6,7 +6,7 @@ "no-string-throw": true, "no-unused-expression": true, "no-duplicate-variable": true, - "no-unused-variable": true, // requires type information in tslint > v4 + "no-unused-variable": true, // requires type information in tslint > v4 only works for hyiene tasks "curly": true, "class-name": true, "semicolon": [ diff --git a/yarn.lock b/yarn.lock index babc32c79839f..2e08f04186ef5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -569,7 +569,7 @@ chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.1.0: +chalk@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" dependencies: @@ -770,6 +770,10 @@ commander@2.8.x: dependencies: graceful-readlink ">= 1.0.0" +commander@^2.12.1: + version "2.13.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" + commandpost@^1.0.0: version "1.2.1" resolved "https://registry.yarnpkg.com/commandpost/-/commandpost-1.2.1.tgz#2e9c4c7508b9dc704afefaa91cab92ee6054cc68" @@ -3070,7 +3074,7 @@ js-yaml@3.6.1: argparse "^1.0.7" esprima "^2.6.0" -js-yaml@3.x, js-yaml@^3.5.1: +js-yaml@3.x, js-yaml@^3.5.1, js-yaml@^3.7.0: version "3.10.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" dependencies: @@ -5485,20 +5489,25 @@ tslib@^1.7.1: version "1.8.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.8.0.tgz#dc604ebad64bcbf696d613da6c954aa0e7ea1eb6" -tslint@^5.8.0: - version "5.8.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.8.0.tgz#1f49ad5b2e77c76c3af4ddcae552ae4e3612eb13" +tslib@^1.8.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8" + +tslint@^5.9.1: + version "5.9.1" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.9.1.tgz#1255f87a3ff57eb0b0e1f0e610a8b4748046c9ae" dependencies: babel-code-frame "^6.22.0" builtin-modules "^1.1.1" - chalk "^2.1.0" - commander "^2.9.0" + chalk "^2.3.0" + commander "^2.12.1" diff "^3.2.0" glob "^7.1.1" + js-yaml "^3.7.0" minimatch "^3.0.4" resolve "^1.3.2" semver "^5.3.0" - tslib "^1.7.1" + tslib "^1.8.0" tsutils "^2.12.1" tsutils@^2.12.1: From 9c553da1c824bea8dab04ef05d3a880b6eed3b87 Mon Sep 17 00:00:00 2001 From: Erich Gamma Date: Sat, 3 Feb 2018 17:47:14 +0100 Subject: [PATCH 3/7] Share a common tslint.json between the language service and the hyiene task --- build/gulpfile.hygiene.js | 6 +++--- tslint-hygiene.json | 6 ++++++ tslint.json | 1 - 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 tslint-hygiene.json diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index bea0169ce44ae..658e63f1fef60 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -226,8 +226,8 @@ const hygiene = exports.hygiene = (some, options) => { } const program = tslint.Linter.createProgram("src/tsconfig.json"); - const configuration = tslint.Configuration.findConfiguration('tslint.json', '.'); - const tslintOptions = { formatter: 'json', rulesDirectory: 'build/lib/tslint' }; + const configuration = tslint.Configuration.findConfiguration('tslint-hygiene.json', '.'); + const tslintOptions = { fix: false, formatter: 'json' }; const linter = new tslint.Linter(tslintOptions, program); const tsl = es.through(function (file) { @@ -266,7 +266,7 @@ const hygiene = exports.hygiene = (some, options) => { this.emit('data', data); }, function () { process.stdout.write('\n'); - + const tslintResult = linter.getResult(); if (tslintResult.failures.length > 0) { reportFailures(tslintResult.failures); diff --git a/tslint-hygiene.json b/tslint-hygiene.json new file mode 100644 index 0000000000000..926be379b869e --- /dev/null +++ b/tslint-hygiene.json @@ -0,0 +1,6 @@ +{ + "extends": "./tslint.json", + "rules": { + "no-unused-variable": true + } +} \ No newline at end of file diff --git a/tslint.json b/tslint.json index 12d553ae18016..31396c2aa56af 100644 --- a/tslint.json +++ b/tslint.json @@ -6,7 +6,6 @@ "no-string-throw": true, "no-unused-expression": true, "no-duplicate-variable": true, - "no-unused-variable": true, // requires type information in tslint > v4 only works for hyiene tasks "curly": true, "class-name": true, "semicolon": [ From 14ecae9b1e2b125447dc0ea0d6e04363949b9d01 Mon Sep 17 00:00:00 2001 From: Erich Gamma Date: Wed, 7 Feb 2018 22:50:02 +0100 Subject: [PATCH 4/7] ensure to only lint files in the src program --- build/gulpfile.hygiene.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index 658e63f1fef60..1667e10196662 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -225,14 +225,16 @@ const hygiene = exports.hygiene = (some, options) => { }); } - const program = tslint.Linter.createProgram("src/tsconfig.json"); + const program = tslint.Linter.createProgram('src/tsconfig.json'); const configuration = tslint.Configuration.findConfiguration('tslint-hygiene.json', '.'); const tslintOptions = { fix: false, formatter: 'json' }; const linter = new tslint.Linter(tslintOptions, program); const tsl = es.through(function (file) { const contents = file.contents.toString('utf8'); - linter.lint(file.relative, contents, configuration.results); + if (file.relative.startsWith('src/')) { // only lint files in src program + linter.lint(file.relative, contents, configuration.results); + } this.emit('data', file); }); From 6b3be13124cdc3b6f3110acea6bb41d6c7fa6cd5 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 12 Feb 2018 12:26:07 +0100 Subject: [PATCH 5/7] :lipstick: --- build/gulpfile.hygiene.js | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index 1667e10196662..ec9108dc67f96 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -119,8 +119,8 @@ const eslintFilter = [ const tslintFilter = [ 'src/**/*.ts', - //'test/**/*.ts', - //'extensions/**/*.ts', + 'test/**/*.ts', + 'extensions/**/*.ts', '!**/fixtures/**', '!**/typings/**', '!**/node_modules/**', @@ -214,17 +214,6 @@ const hygiene = exports.hygiene = (some, options) => { }); }); - function reportFailures(failures) { - failures.forEach(failure => { - const name = failure.name || failure.fileName; - const position = failure.startPosition; - const line = position.lineAndCharacter ? position.lineAndCharacter.line : position.line; - const character = position.lineAndCharacter ? position.lineAndCharacter.character : position.character; - - console.error(`${name}:${line + 1}:${character + 1}:${failure.failure}`); - }); - } - const program = tslint.Linter.createProgram('src/tsconfig.json'); const configuration = tslint.Configuration.findConfiguration('tslint-hygiene.json', '.'); const tslintOptions = { fix: false, formatter: 'json' }; @@ -271,7 +260,15 @@ const hygiene = exports.hygiene = (some, options) => { const tslintResult = linter.getResult(); if (tslintResult.failures.length > 0) { - reportFailures(tslintResult.failures); + for (const failure of tslintResult.failures) { + const name = failure.name || failure.fileName; + const position = failure.startPosition; + const line = position.lineAndCharacter ? position.lineAndCharacter.line : position.line; + const character = position.lineAndCharacter ? position.lineAndCharacter.character : position.character; + + console.error(`${name}:${line + 1}:${character + 1}:${failure.failure}`); + } + errorCount += tslintResult.failures.length; } From 19294a32fc9bb218ae4f8b4c5ee9e29ff3e7dd60 Mon Sep 17 00:00:00 2001 From: Erich Gamma Date: Wed, 21 Feb 2018 22:05:34 +0100 Subject: [PATCH 6/7] Enable linting for extensions and tests --- build/gulpfile.hygiene.js | 74 +++++++++++++++++++++++++++++++-------- 1 file changed, 59 insertions(+), 15 deletions(-) diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index edefbf721a49a..2881697ecd81f 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -13,6 +13,8 @@ const gulpeslint = require('gulp-eslint'); const tsfmt = require('typescript-formatter'); const tslint = require('tslint'); const vfs = require('vinyl-fs'); +const path = require('path'); +const fs = require('fs'); /** * Hygiene works by creating cascading subsets of all our files and @@ -219,14 +221,55 @@ const hygiene = exports.hygiene = (some, options) => { }); }); - const program = tslint.Linter.createProgram('src/tsconfig.json'); + let linterForProgram = {}; // maps tslint programs to its corresponding Linter const configuration = tslint.Configuration.findConfiguration('tslint-hygiene.json', '.'); - const tslintOptions = { fix: false, formatter: 'json' }; - const linter = new tslint.Linter(tslintOptions, program); + + function createLinter(tsconfig) { + const program = tslint.Linter.createProgram(tsconfig); + const tslintOptions = { fix: false, formatter: 'json' }; + return new tslint.Linter(tslintOptions, program); + } + + function findTsConfig(segments) { + let fsPath = segments.reduce((p, each) => path.join(p, each)); + let tsconfig = path.join(fsPath, 'tsconfig.json'); + if (fs.existsSync(tsconfig)) { + return tsconfig; + } else if (segments.length > 1) { + segments.splice(-1, 1); + return findTsConfig(segments); + } else { + return undefined; + } + } + + function getLinter(file) { + let segments = file.relative.split(path.sep); + + // hard code the location of the tsconfig.json for the source folder to eliminate the lookup for the tsconfig.json + if (segments[0] === 'src') { + if (!linterForProgram['src']) { + linterForProgram['src'] = createLinter('src/tsconfig.json'); + } + return linterForProgram['src']; + } + else { + segments.splice(-1, 1); + let tsconfig = findTsConfig(segments); + if (!tsconfig) { + return undefined; + } + if (!linterForProgram[tsconfig]) { + linterForProgram[tsconfig] = createLinter(tsconfig); + } + return linterForProgram[tsconfig]; + } + } const tsl = es.through(function (file) { const contents = file.contents.toString('utf8'); - if (file.relative.startsWith('src/')) { // only lint files in src program + let linter = getLinter(file); + if (linter) { linter.lint(file.relative, contents, configuration.results); } this.emit('data', file); @@ -263,18 +306,19 @@ const hygiene = exports.hygiene = (some, options) => { }, function () { process.stdout.write('\n'); - const tslintResult = linter.getResult(); - if (tslintResult.failures.length > 0) { - for (const failure of tslintResult.failures) { - const name = failure.getFailure() || failure.getFileName; - const position = failure.getStartPosition(); - const line = position.getLineAndCharacter().line; - const character = position.getLineAndCharacter().character; - - console.error(`${name}:${line + 1}:${character + 1}:${failure.getFailure()}`); + for (let linter in linterForProgram) { + const tslintResult = linterForProgram[linter].getResult(); + if (tslintResult.failures.length > 0) { + for (const failure of tslintResult.failures) { + const name = failure.getFileName(); + const position = failure.getStartPosition(); + const line = position.getLineAndCharacter().line; + const character = position.getLineAndCharacter().character; + + console.error(`${name}:${line + 1}:${character + 1}:${failure.getFailure()}`); + } + errorCount += tslintResult.failures.length; } - - errorCount += tslintResult.failures.length; } if (errorCount > 0) { From e79e8e04864ae1aaf5ed952953b26d4d35e67196 Mon Sep 17 00:00:00 2001 From: Erich Gamma Date: Wed, 21 Feb 2018 22:06:49 +0100 Subject: [PATCH 7/7] removed unused-variables and disabled tslint rule if needed --- extensions/configuration-editing/src/extension.ts | 5 ++--- extensions/git/src/api.ts | 2 +- extensions/git/src/commands.ts | 7 ++++--- extensions/git/src/decorationProvider.ts | 4 ++-- extensions/git/src/decorators.ts | 1 + extensions/git/src/git.ts | 1 + extensions/git/src/main.ts | 2 +- extensions/git/src/model.ts | 4 ++-- extensions/git/src/repository.ts | 3 +++ 9 files changed, 17 insertions(+), 12 deletions(-) diff --git a/extensions/configuration-editing/src/extension.ts b/extensions/configuration-editing/src/extension.ts index 2266b8005af55..17dbaa543a249 100644 --- a/extensions/configuration-editing/src/extension.ts +++ b/extensions/configuration-editing/src/extension.ts @@ -7,7 +7,7 @@ import * as nls from 'vscode-nls'; const localize = nls.loadMessageBundle(); import * as vscode from 'vscode'; -import { getLocation, visit, parse, ParseError, ParseErrorCode } from 'jsonc-parser'; +import { getLocation, visit, parse, ParseErrorCode } from 'jsonc-parser'; import * as path from 'path'; import { SettingsDocument } from './settingsDocumentHelper'; @@ -18,7 +18,6 @@ const decoration = vscode.window.createTextEditorDecorationType({ let pendingLaunchJsonDecoration: NodeJS.Timer; export function activate(context: vscode.ExtensionContext): void { - //keybindings.json command-suggestions context.subscriptions.push(registerKeybindingsCompletions()); @@ -70,7 +69,6 @@ function autoFixSettingsJSON(willSaveEvent: vscode.TextDocumentWillSaveEvent): v onError(error: ParseErrorCode, offset: number, length: number): void { if (error === ParseErrorCode.CommaExpected && lastEndOfSomething > -1) { - const errorPosition = document.positionAt(offset); const fixPosition = document.positionAt(lastEndOfSomething); edit.insert(document.uri, fixPosition, ','); @@ -106,6 +104,7 @@ function registerSettingsCompletions(): vscode.Disposable { }); } +// tslint:disable-next-line:no-unused-variable function provideContributedLocalesProposals(range: vscode.Range): vscode.ProviderResult { const contributedLocales: string[] = []; for (const extension of vscode.extensions.all) { diff --git a/extensions/git/src/api.ts b/extensions/git/src/api.ts index 4e569a8e88422..8d94502e041eb 100644 --- a/extensions/git/src/api.ts +++ b/extensions/git/src/api.ts @@ -6,7 +6,7 @@ 'use strict'; import { Model } from './model'; -import { SourceControlInputBox, Uri } from 'vscode'; +import { Uri } from 'vscode'; export interface InputBox { value: string; diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 776e6c8ac1b4f..755c4a2a4486c 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -7,10 +7,10 @@ import { Uri, commands, Disposable, window, workspace, QuickPickItem, OutputChannel, Range, WorkspaceEdit, Position, LineChange, SourceControlResourceState, TextDocumentShowOptions, ViewColumn, ProgressLocation, TextEditor, CancellationTokenSource, StatusBarAlignment } from 'vscode'; import { Ref, RefType, Git, GitErrorCodes, Branch } from './git'; -import { Repository, Resource, Status, CommitOptions, ResourceGroupType, RepositoryState } from './repository'; +import { Repository, Resource, Status, CommitOptions, ResourceGroupType } from './repository'; import { Model } from './model'; import { toGitUri, fromGitUri } from './uri'; -import { grep, eventToPromise, isDescendant } from './util'; +import { grep, isDescendant } from './util'; import { applyLineChanges, intersectDiffWithRange, toLineRanges, invertLineChange, getModifiedRange } from './staging'; import * as path from 'path'; import { lstat, Stats } from 'fs'; @@ -237,7 +237,7 @@ export class CommandCenter { } const { size, object } = await repository.lstree(gitRef, uri.fsPath); - const { mimetype, encoding } = await repository.detectObjectType(object); + const { mimetype } = await repository.detectObjectType(object); if (mimetype === 'text/plain') { return toGitUri(uri, ref); @@ -1051,6 +1051,7 @@ export class CommandCenter { value = (await repository.getCommit(repository.HEAD.commit)).message; } + // tslint:disable-next-line:no-unused-variable const getPreviousCommitMessage = async () => { //Only return the previous commit message if it's an amend commit and the repo already has a commit if (opts && opts.amend && repository.HEAD && repository.HEAD.commit) { diff --git a/extensions/git/src/decorationProvider.ts b/extensions/git/src/decorationProvider.ts index a25f6052d6922..48594918f5d92 100644 --- a/extensions/git/src/decorationProvider.ts +++ b/extensions/git/src/decorationProvider.ts @@ -10,8 +10,8 @@ import * as path from 'path'; import { Repository, GitResourceGroup, Status } from './repository'; import { Model } from './model'; import { debounce } from './decorators'; -import { filterEvent, dispose, anyEvent, mapEvent, fireEvent } from './util'; -import { Submodule, GitErrorCodes } from './git'; +import { filterEvent, dispose, anyEvent, fireEvent } from './util'; +import { GitErrorCodes } from './git'; type Callback = { resolve: (status: boolean) => void, reject: (err: any) => void }; diff --git a/extensions/git/src/decorators.ts b/extensions/git/src/decorators.ts index 83ee04b17adf1..ce705e1da3fdc 100644 --- a/extensions/git/src/decorators.ts +++ b/extensions/git/src/decorators.ts @@ -78,6 +78,7 @@ function _throttle(fn: Function, key: string): Function { export const throttle = decorate(_throttle); +// tslint:disable-next-line:no-unused-variable function _sequentialize(fn: Function, key: string): Function { const currentKey = `__$sequence$${key}`; diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index 7074ab22b902d..9ae633d6ade2b 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -362,6 +362,7 @@ function getGitErrorCode(stderr: string): string | undefined { export class Git { private gitPath: string; + // tslint:disable-next-line:no-unused-variable private version: string; private env: any; diff --git a/extensions/git/src/main.ts b/extensions/git/src/main.ts index a003fe9bcfbe1..e7e0c7e876808 100644 --- a/extensions/git/src/main.ts +++ b/extensions/git/src/main.ts @@ -14,7 +14,7 @@ import { CommandCenter } from './commands'; import { GitContentProvider } from './contentProvider'; import { GitDecorations } from './decorationProvider'; import { Askpass } from './askpass'; -import { toDisposable, filterEvent, mapEvent, eventToPromise } from './util'; +import { toDisposable, filterEvent, eventToPromise } from './util'; import TelemetryReporter from 'vscode-extension-telemetry'; import { API, createApi } from './api'; diff --git a/extensions/git/src/model.ts b/extensions/git/src/model.ts index 235b07787ba07..3c0e8d6b59d12 100644 --- a/extensions/git/src/model.ts +++ b/extensions/git/src/model.ts @@ -5,10 +5,10 @@ 'use strict'; -import { workspace, WorkspaceFoldersChangeEvent, Uri, window, Event, EventEmitter, QuickPickItem, Disposable, SourceControl, SourceControlResourceGroup, TextEditor, Memento, ConfigurationChangeEvent } from 'vscode'; +import { workspace, WorkspaceFoldersChangeEvent, Uri, window, Event, EventEmitter, QuickPickItem, Disposable, SourceControl, SourceControlResourceGroup, TextEditor, Memento } from 'vscode'; import { Repository, RepositoryState } from './repository'; import { memoize, sequentialize, debounce } from './decorators'; -import { dispose, anyEvent, filterEvent, IDisposable, isDescendant, find, firstIndex } from './util'; +import { dispose, anyEvent, filterEvent, isDescendant, firstIndex } from './util'; import { Git, GitErrorCodes } from './git'; import * as path from 'path'; import * as fs from 'fs'; diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index 3824f01026566..c20311c8031a1 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -398,6 +398,7 @@ class ProgressManager { private disposable: IDisposable = EmptyDisposable; + // tslint:disable-next-line:no-unused-variable constructor(private repository: Repository) { const start = onceEvent(filterEvent(repository.onDidChangeOperations, () => repository.operations.shouldShowProgress())); const end = onceEvent(filterEvent(debounceEvent(repository.onDidChangeOperations, 300), () => !repository.operations.shouldShowProgress())); @@ -791,6 +792,7 @@ export class Repository implements Disposable { return await this.run(Operation.Show, async () => { const relativePath = path.relative(this.repository.root, filePath).replace(/\\/g, '/'); const configFiles = workspace.getConfiguration('files', Uri.file(filePath)); + // tslint:disable-next-line:no-unused-variable const encoding = configFiles.get('encoding'); // TODO@joao: REsource config api @@ -1009,6 +1011,7 @@ export class Repository implements Disposable { case 'UU': return merge.push(new Resource(ResourceGroupType.Merge, uri, Status.BOTH_MODIFIED, useIcons)); } + // tslint:disable-next-line:no-unused-variable let isModifiedInIndex = false; switch (raw.x) {