eslint: fix lint error
This commit is contained in:
		@@ -11,7 +11,7 @@
 | 
				
			|||||||
        "Other"
 | 
					        "Other"
 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
    "activationEvents": [
 | 
					    "activationEvents": [
 | 
				
			||||||
        "onCommand:extension.helloWorld"
 | 
					        "*"
 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
    "main": "./dist/extension.js",
 | 
					    "main": "./dist/extension.js",
 | 
				
			||||||
    "contributes": {
 | 
					    "contributes": {
 | 
				
			||||||
@@ -60,8 +60,8 @@
 | 
				
			|||||||
        "vscode:prepublish": "yarn run compile",
 | 
					        "vscode:prepublish": "yarn run compile",
 | 
				
			||||||
        "compile": "tsc -p ./",
 | 
					        "compile": "tsc -p ./",
 | 
				
			||||||
        "watch": "tsc -watch -p ./",
 | 
					        "watch": "tsc -watch -p ./",
 | 
				
			||||||
        "postinstall": "node ../../node_modules/vscode/bin/install",
 | 
					        "postinstall": "node ../../../node_modules/vscode/bin/install",
 | 
				
			||||||
        "test": "yarn run compile && node ./node_modules/vscode/bin/test"
 | 
					        "test": "yarn run compile && node ../../../node_modules/vscode/bin/test"
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "dependencies": {
 | 
					    "dependencies": {
 | 
				
			||||||
        "@dayu/docker-api": "^0.0.1",
 | 
					        "@dayu/docker-api": "^0.0.1",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,14 +1,16 @@
 | 
				
			|||||||
// The module 'vscode' contains the VS Code extensibility API
 | 
					// The module 'vscode' contains the VS Code extensibility API
 | 
				
			||||||
// Import the module and reference it with the alias vscode in your code below
 | 
					// Import the module and reference it with the alias vscode in your code below
 | 
				
			||||||
import * as vscode from 'vscode';
 | 
					import * as vscode from 'vscode';
 | 
				
			||||||
process.env.DOCKER_HOST = '/var/run/docker.sock'
 | 
					process.env.DOCKER_HOST = 'https://dscli.miaowoo.cc';
 | 
				
			||||||
import { OpenFaasProvider, DockerProvider } from './provider'
 | 
					import { OpenFaasProvider, DockerProvider } from './provider';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// this method is called when your extension is activated
 | 
					// this method is called when your extension is activated
 | 
				
			||||||
// your extension is activated the very first time the command is executed
 | 
					// your extension is activated the very first time the command is executed
 | 
				
			||||||
export function activate(context: vscode.ExtensionContext) {
 | 
					export function activate(context: vscode.ExtensionContext) {
 | 
				
			||||||
    console.log('init...')
 | 
					    console.log('init...');
 | 
				
			||||||
 | 
					    // tslint:disable-next-line: no-unused-expression
 | 
				
			||||||
    new DockerProvider(context);
 | 
					    new DockerProvider(context);
 | 
				
			||||||
 | 
					    // tslint:disable-next-line: no-unused-expression
 | 
				
			||||||
    new OpenFaasProvider(context);
 | 
					    new OpenFaasProvider(context);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
import * as vscode from 'vscode'
 | 
					import * as vscode from 'vscode';
 | 
				
			||||||
import * as faas from '@dayu/faas'
 | 
					import * as faas from '@dayu/faas';
 | 
				
			||||||
import { BaseProvider, ItemContextValue } from './base'
 | 
					import { BaseProvider, ItemContextValue } from './base';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum Type {
 | 
					enum Type {
 | 
				
			||||||
    ROOT = "ROOT",
 | 
					    ROOT = "ROOT",
 | 
				
			||||||
@@ -10,10 +10,10 @@ export class OpenFaasProvider extends BaseProvider<vscode.TreeItem> {
 | 
				
			|||||||
    onDidChangeTreeData?: vscode.Event<vscode.TreeItem>;
 | 
					    onDidChangeTreeData?: vscode.Event<vscode.TreeItem>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    constructor(context: vscode.ExtensionContext) {
 | 
					    constructor(context: vscode.ExtensionContext) {
 | 
				
			||||||
        super()
 | 
					        super();
 | 
				
			||||||
        context.subscriptions.push(
 | 
					        context.subscriptions.push(
 | 
				
			||||||
            vscode.window.registerTreeDataProvider('openfaas-explorer', this)
 | 
					            vscode.window.registerTreeDataProvider('openfaas-explorer', this)
 | 
				
			||||||
        )
 | 
					        );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    getTreeItem(element: vscode.TreeItem): vscode.TreeItem | Promise<vscode.TreeItem> {
 | 
					    getTreeItem(element: vscode.TreeItem): vscode.TreeItem | Promise<vscode.TreeItem> {
 | 
				
			||||||
@@ -29,7 +29,7 @@ export class OpenFaasProvider extends BaseProvider<vscode.TreeItem> {
 | 
				
			|||||||
                    type: Type.ROOT
 | 
					                    type: Type.ROOT
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                icon: "logo"
 | 
					                icon: "logo"
 | 
				
			||||||
            })]
 | 
					            })];
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        let value: ItemContextValue = JSON.parse(element.contextValue);
 | 
					        let value: ItemContextValue = JSON.parse(element.contextValue);
 | 
				
			||||||
        switch (value.type) {
 | 
					        switch (value.type) {
 | 
				
			||||||
@@ -39,7 +39,7 @@ export class OpenFaasProvider extends BaseProvider<vscode.TreeItem> {
 | 
				
			|||||||
                    return this.createTreeItem({
 | 
					                    return this.createTreeItem({
 | 
				
			||||||
                        label: f.name,
 | 
					                        label: f.name,
 | 
				
			||||||
                        tooltip: JSON.stringify(f, undefined, 2)
 | 
					                        tooltip: JSON.stringify(f, undefined, 2)
 | 
				
			||||||
                    })
 | 
					                    });
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
            default:
 | 
					            default:
 | 
				
			||||||
                return [];
 | 
					                return [];
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user