Skip to content

Commit cc417ee

Browse files
committed
fix tslint errors
1 parent d9e9102 commit cc417ee

File tree

11 files changed

+63
-70
lines changed

11 files changed

+63
-70
lines changed

package-lock.json

Lines changed: 42 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@
506506
"@types/js-yaml": "^3.11.2",
507507
"@types/mkdirp": "^0.5.2",
508508
"@types/mocha": "^5.2.5",
509-
"@types/node": "^10.12.10",
509+
"@types/node": "^10.12.11",
510510
"@types/opn": "^5.1.0",
511511
"@types/request": "^2.48.1",
512512
"@types/shelljs": "^0.8.0",
@@ -523,9 +523,9 @@
523523
"proxyquire": "^2.1.0",
524524
"remap-istanbul": "^0.12.0",
525525
"sinon": "^7.1.1",
526-
"sinon-chai": "^3.2.0",
526+
"sinon-chai": "^3.3.0",
527527
"tslint": "^5.11.0",
528-
"typescript": "^3.1.6",
528+
"typescript": "^3.2.1",
529529
"vscode": "^1.1.21"
530530
},
531531
"dependencies": {

src/tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export class ToolsConfig {
162162
let detectedVersion: string;
163163
if (fs.existsSync(location)) {
164164
const version = new RegExp(`${cmd} v([\\d\\.]+)`);
165-
const result = await Cli.getInstance().execute(`"${location}" version`);
165+
const result = await Cli.getInstance().execute(`"${location}" version`);
166166
if (result.stdout) {
167167
const toolVersion: string[] = result.stdout.trim().split('\n').filter((value) => {
168168
return value.match(version);

src/util/progress.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class Progress {
5252
location: vscode.ProgressLocation.Notification,
5353
title},
5454
async (progress: vscode.Progress<{increment: number, message: string}>, token: vscode.CancellationToken) => {
55-
let result = await odoctl.getInstance().execute(cmd, process.cwd(), false);
55+
const result = await odoctl.getInstance().execute(cmd, process.cwd(), false);
5656
result.error ? reject(result.error) : resolve();
5757
}
5858
);

src/util/windowUtils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import { window, Terminal, TerminalOptions } from 'vscode';
99
import * as path from 'path';
10-
import { Platform } from './platform';
1110

1211
export class WindowUtil {
1312

test/extension.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import { activate } from '../src/extension';
1717
import { Cluster } from '../src/openshift/cluster';
1818
import { Application } from '../src/openshift/application';
1919
import { Catalog } from '../src/openshift/catalog';
20-
import { Component} from '../src/openshift/component';
21-
import { Project} from '../src/openshift/project';
22-
import { Service} from '../src/openshift/service';
23-
import { Storage} from '../src/openshift/storage';
24-
import { Url} from '../src/openshift/url';
20+
import { Component } from '../src/openshift/component';
21+
import { Project } from '../src/openshift/project';
22+
import { Service } from '../src/openshift/service';
23+
import { Storage } from '../src/openshift/storage';
24+
import { Url } from '../src/openshift/url';
2525
import packagejson = require('../package.json');
2626

2727
const expect = chai.expect;
@@ -65,10 +65,10 @@ suite('openshift connector Extension', async () => {
6565
});
6666

6767
async function getStaticMethosToStub(osc: string[]): Promise<string[]> {
68-
let mths: Set<string> = new Set();
69-
osc.forEach(name => {
68+
const mths: Set<string> = new Set();
69+
osc.forEach((name) => {
7070
name.replace('.palette', '');
71-
let segs: string[] = name.split('.');
71+
const segs: string[] = name.split('.');
7272
let methName: string = segs[segs.length-1];
7373
methName = methName === 'delete'? 'del' : methName;
7474
!mths.has(methName) && mths.add(methName);
@@ -81,8 +81,8 @@ suite('openshift connector Extension', async () => {
8181
const registerTreeDataProviderStub = sandbox.stub(vscode.window, 'registerTreeDataProvider');
8282
sandbox.stub(vscode.window, 'showErrorMessage');
8383
await activate(context);
84-
let cmds:string[] = await vscode.commands.getCommands();
85-
let osc:string[] = cmds.filter((item) => item.includes('openshift.'));
84+
const cmds: string[] = await vscode.commands.getCommands();
85+
const osc: string[] = cmds.filter((item) => item.includes('openshift.'));
8686
expect(registerTreeDataProviderStub).calledOnce;
8787
const mths: string[] = await getStaticMethosToStub(osc);
8888
(<any>[Application, Catalog, Cluster, Component, Project, Service, Storage, Url]).forEach(async (item) => {
@@ -91,7 +91,7 @@ suite('openshift connector Extension', async () => {
9191
sandbox.stub(item, name).resolves();
9292
}
9393
});
94-
})
94+
});
9595
osc.forEach((item) => vscode.commands.executeCommand(item));
9696
expect(vscode.window.showErrorMessage).has.not.been.called;
9797
});

test/odo.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ suite("odo", () => {
101101
};
102102
toolsStub.restore();
103103
toolsStub = sandbox.stub(ToolsConfig, 'detectOrDownload').resolves(path.join('segment1', 'segment2'));
104-
let ctStub = sandbox.stub(WindowUtil, 'createTerminal').returns(termFake);
104+
const ctStub = sandbox.stub(WindowUtil, 'createTerminal').returns(termFake);
105105
await odoCli.executeInTerminal('cmd');
106106
expect(termFake.sendText).calledOnce;
107107
expect(termFake.show).calledOnce;
@@ -205,7 +205,7 @@ suite("odo", () => {
205205
let e;
206206
try {
207207
const result = await odoCli.getServiceTemplates();
208-
} catch(err) {
208+
} catch (err) {
209209
e = err;
210210
}
211211

test/openshift/component.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ suite('Openshift/Component', () => {
3838
const componentType = 'nodejs';
3939
const version = 'latest';
4040
const folder = { uri: { fsPath: 'folder' } };
41-
let quickPickStub: sinon.SinonStub,
42-
inputStub: sinon.SinonStub,
41+
let quickPickStub: sinon.SinonStub,
42+
inputStub: sinon.SinonStub,
4343
progressStub: sinon.SinonStub,
4444
progressCmdStub: sinon.SinonStub;
4545

@@ -184,7 +184,7 @@ suite('Openshift/Component', () => {
184184
});
185185

186186
test('happy path works', async () => {
187-
187+
188188
const result = await Component.create(appItem);
189189

190190
expect(result).equals(`Component '${componentItem.getName()}' successfully created`);

test/util/progress.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ suite('Progress Utility', () => {
5656
test('throw an error if a command fails', async () => {
5757
const error = new Error(errorMessage);
5858
execStub = sandbox.stub(OdoImpl.prototype, 'execute').rejects(error);
59-
const spy = sandbox.spy(vscode.window, 'showErrorMessage');
6059
let e;
6160
try {
6261
await Progress.execWithProgress(options, steps, OdoImpl.getInstance());
@@ -70,9 +69,7 @@ suite('Progress Utility', () => {
7069
});
7170

7271
test('execCmdWithProgress returned promice resolves in case of cmd finished sucessfully', () => {
73-
const error = new Error(errorMessage);
7472
execStub = sandbox.stub(OdoImpl.prototype, 'execute').resolves({error: undefined, stdout: '', stderr: ''});
75-
let e;
7673
Progress.execCmdWithProgress('title', 'cmd').catch(() => {
7774
expect.fail(true, false, 'returned promise should not be rejected');
7875
});

test/util/watch.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import * as chai from 'chai';
99
import * as sinonChai from 'sinon-chai';
1010
import * as sinon from 'sinon';
11-
import * as path from 'path';
1211
import * as fs from 'fs-extra';
1312
import { WatchUtil } from '../../src/util/watch';
1413

0 commit comments

Comments
 (0)