eslint: fix lint error

This commit is contained in:
MiaoWoo 2019-08-27 16:35:27 +08:00
parent 3e480da539
commit cabf6cf613
3 changed files with 15 additions and 13 deletions

View File

@ -11,7 +11,7 @@
"Other"
],
"activationEvents": [
"onCommand:extension.helloWorld"
"*"
],
"main": "./dist/extension.js",
"contributes": {
@ -60,8 +60,8 @@
"vscode:prepublish": "yarn run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"postinstall": "node ../../node_modules/vscode/bin/install",
"test": "yarn run compile && node ./node_modules/vscode/bin/test"
"postinstall": "node ../../../node_modules/vscode/bin/install",
"test": "yarn run compile && node ../../../node_modules/vscode/bin/test"
},
"dependencies": {
"@dayu/docker-api": "^0.0.1",

View File

@ -1,14 +1,16 @@
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';
process.env.DOCKER_HOST = '/var/run/docker.sock'
import { OpenFaasProvider, DockerProvider } from './provider'
process.env.DOCKER_HOST = 'https://dscli.miaowoo.cc';
import { OpenFaasProvider, DockerProvider } from './provider';
// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export function activate(context: vscode.ExtensionContext) {
console.log('init...')
console.log('init...');
// tslint:disable-next-line: no-unused-expression
new DockerProvider(context);
// tslint:disable-next-line: no-unused-expression
new OpenFaasProvider(context);
}

View File

@ -1,6 +1,6 @@
import * as vscode from 'vscode'
import * as faas from '@dayu/faas'
import { BaseProvider, ItemContextValue } from './base'
import * as vscode from 'vscode';
import * as faas from '@dayu/faas';
import { BaseProvider, ItemContextValue } from './base';
enum Type {
ROOT = "ROOT",
@ -10,10 +10,10 @@ export class OpenFaasProvider extends BaseProvider<vscode.TreeItem> {
onDidChangeTreeData?: vscode.Event<vscode.TreeItem>;
constructor(context: vscode.ExtensionContext) {
super()
super();
context.subscriptions.push(
vscode.window.registerTreeDataProvider('openfaas-explorer', this)
)
);
}
getTreeItem(element: vscode.TreeItem): vscode.TreeItem | Promise<vscode.TreeItem> {
@ -29,7 +29,7 @@ export class OpenFaasProvider extends BaseProvider<vscode.TreeItem> {
type: Type.ROOT
},
icon: "logo"
})]
})];
}
let value: ItemContextValue = JSON.parse(element.contextValue);
switch (value.type) {
@ -39,7 +39,7 @@ export class OpenFaasProvider extends BaseProvider<vscode.TreeItem> {
return this.createTreeItem({
label: f.name,
tooltip: JSON.stringify(f, undefined, 2)
})
});
});
default:
return [];