diff --git a/.eslintrc.json b/.eslintrc.json index 3ba742de..77faab9e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -28,6 +28,7 @@ "no-extra-semi": "warn", "no-case-declarations": "warn", "no-useless-escape" : "warn", - "no-prototype-builtins": "warn" + "no-prototype-builtins": "warn", + "no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }] } } diff --git a/src/CfgEditor/CfgEditorPanel.ts b/src/CfgEditor/CfgEditorPanel.ts index 1de1c5cc..3fb0e127 100644 --- a/src/CfgEditor/CfgEditorPanel.ts +++ b/src/CfgEditor/CfgEditorPanel.ts @@ -174,7 +174,7 @@ export class CfgEditorPanel implements vscode.CustomTextEditorProvider { } }); - webviewPanel.onDidChangeViewState(e => { + webviewPanel.onDidChangeViewState(() => { if (webviewPanel.visible) { vscode.commands.executeCommand('one.explorer.revealInOneExplorer', document.fileName); } diff --git a/src/CircleGraph/CircleGraph.ts b/src/CircleGraph/CircleGraph.ts index c9364006..f3447462 100644 --- a/src/CircleGraph/CircleGraph.ts +++ b/src/CircleGraph/CircleGraph.ts @@ -84,7 +84,7 @@ export class CircleGraphPanel extends CircleGraphCtrl { this._panel.onDidDispose(() => this.dispose(), null, this._disposables); // Update the content based on view changes - this._panel.onDidChangeViewState(e => { + this._panel.onDidChangeViewState(() => { if (this._panel.visible) { // NOTE if we call this.update(), it'll reload the model which may take time. // TODO call conditional this.update() when necessary. diff --git a/src/CircleGraph/CircleGraphCtrl.ts b/src/CircleGraph/CircleGraphCtrl.ts index 1cdab92d..9a26acf9 100644 --- a/src/CircleGraph/CircleGraphCtrl.ts +++ b/src/CircleGraph/CircleGraphCtrl.ts @@ -342,7 +342,7 @@ export class CircleGraphCtrl { total: this._modelLength, responseArray: modelData }); - fs.close(fd, (err) => {}); + fs.close(fd, () => {}); }); } diff --git a/src/CircleGraph/CircleViewer.ts b/src/CircleGraph/CircleViewer.ts index 52b88eac..b25521ca 100644 --- a/src/CircleGraph/CircleViewer.ts +++ b/src/CircleGraph/CircleViewer.ts @@ -124,7 +124,7 @@ export class CircleViewerProvider implements // CustomReadonlyEditorProvider implements async openCustomDocument( - uri: vscode.Uri, openContext: {backupId?: string}, + uri: vscode.Uri, _openContext: {backupId?: string}, _token: vscode.CancellationToken): Promise { const document: CircleViewerDocument = await CircleViewerDocument.create(uri); // NOTE as a readonly viewer, there is not much to do diff --git a/src/Execute/DeviceViewProvider.ts b/src/Execute/DeviceViewProvider.ts index 416a1b62..225ffed0 100644 --- a/src/Execute/DeviceViewProvider.ts +++ b/src/Execute/DeviceViewProvider.ts @@ -21,7 +21,6 @@ import {globalBackendMap} from '../Backend/API'; import {Command} from '../Backend/Command'; import {Executor} from '../Backend/Executor'; import {DeviceSpec, supportedSpecs} from '../Backend/Spec'; -import {Balloon} from '../Utils/Balloon'; import {Logger} from '../Utils/Logger'; import {Device} from './Device'; @@ -150,7 +149,7 @@ export class DeviceViewProvider implements vscode.TreeDataProvider { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { let result: string = ''; let error: string = ''; let cmdSpawn = cp.spawn(cmd.str(), {shell: false}); diff --git a/src/Job/ToolRunner.ts b/src/Job/ToolRunner.ts index 37bad028..eb65d9e3 100644 --- a/src/Job/ToolRunner.ts +++ b/src/Job/ToolRunner.ts @@ -20,7 +20,6 @@ import {Logger} from '../Utils/Logger'; import {pipedSpawn} from '../Utils/PipedSpawn'; import {ToolArgs} from './ToolArgs'; -const path = require('path'); const which = require('which'); const K_DATA: string = 'data'; diff --git a/src/Jsontracer/JsonTracerViewerPanel.ts b/src/Jsontracer/JsonTracerViewerPanel.ts index c1c7844d..6fadee18 100644 --- a/src/Jsontracer/JsonTracerViewerPanel.ts +++ b/src/Jsontracer/JsonTracerViewerPanel.ts @@ -114,7 +114,7 @@ export class JsonTracerViewerPanel implements vscode.CustomTextEditorProvider { } }); - webviewPanel.onDidChangeViewState(e => { + webviewPanel.onDidChangeViewState(() => { vscode.commands.executeCommand( 'setContext', JsonTracerViewerPanel.viewType, webviewPanel.visible); }, null, this._disposables); diff --git a/src/PartEditor/PartEditor.ts b/src/PartEditor/PartEditor.ts index 494511fa..18d589fd 100644 --- a/src/PartEditor/PartEditor.ts +++ b/src/PartEditor/PartEditor.ts @@ -98,7 +98,7 @@ class PartEditor implements PartGraphEvent { }); this._panel.onDidChangeViewState( - e => { + () => { // TODO implement }, null, this._disposables); @@ -286,7 +286,7 @@ class PartEditor implements PartGraphEvent { } }); - cmd.on(K_ERROR, (err) => { + cmd.on(K_ERROR, () => { let msg = 'Failed to run circle-operator: ' + this._modelFileName; Balloon.error(msg); reject(msg); @@ -352,7 +352,7 @@ class PartEditor implements PartGraphEvent { } // PartGraphEvent implements - public onSelection(names: string[], tensors: string[]) { + public onSelection(names: string[], _tensors: string[]) { this._webview.postMessage({command: 'selectWithNames', selection: names}); } } @@ -388,7 +388,7 @@ export class PartEditorProvider implements vscode.CustomTextEditorProvider, Part public async resolveCustomTextEditor( document: vscode.TextDocument, webviewPanel: vscode.WebviewPanel, - token: vscode.CancellationToken): Promise { + _token: vscode.CancellationToken): Promise { let partEditor = new PartEditor(document, webviewPanel, PartEditorProvider.nextId++); this._partEditors.push(partEditor); diff --git a/src/PartEditor/PartGraphSelector.ts b/src/PartEditor/PartGraphSelector.ts index 9a9647c3..b7633797 100644 --- a/src/PartEditor/PartGraphSelector.ts +++ b/src/PartEditor/PartGraphSelector.ts @@ -205,7 +205,7 @@ export class PartGraphSelPanel extends CircleGraphCtrl implements CircleGraphEve this._panel.onDidDispose(() => this.dispose(), null, this._disposables); // Update the content based on view changes - this._panel.onDidChangeViewState(e => { + this._panel.onDidChangeViewState(() => { if (this._panel.visible) { // NOTE if we call this.update(), it'll reload the model which may take time. // TODO call conditional this.update() when necessary. diff --git a/src/Utils/MultiStepInput.ts b/src/Utils/MultiStepInput.ts index 19cf0c85..8497094d 100644 --- a/src/Utils/MultiStepInput.ts +++ b/src/Utils/MultiStepInput.ts @@ -57,12 +57,12 @@ interface InputBoxParameters { /* istanbul ignore next */ class MultiStepInput { - static async run(start: InputStep) { + static async run(start: InputStep) { const input = new MultiStepInput(); return input.stepThrough(start); } - static async runSteps(steps: InputStep[]) { + static async runSteps(steps: InputStep[]) { if (steps.length === 0) { throw new Error('not enough steps'); } @@ -80,7 +80,7 @@ class MultiStepInput { // this variable sets to public. public steps: InputStep[] = []; - private async stepThrough(start: InputStep) { + private async stepThrough(start: InputStep) { let step: InputStep|void = start; while (step) { this.steps.push(step); diff --git a/src/View/InstallQuickInput.ts b/src/View/InstallQuickInput.ts index 582ea672..b80647e9 100644 --- a/src/View/InstallQuickInput.ts +++ b/src/View/InstallQuickInput.ts @@ -25,7 +25,7 @@ import {InputStep, MultiStepInput} from '../Utils/MultiStepInput'; async function shouldResume() { // Could show a notification with the option to resume. return new Promise( - (resolve, reject) => { + () => { // noop }); } @@ -268,7 +268,7 @@ class InstallQuickInput { } /* istanbul ignore next */ - public async updateBackend(input: MultiStepInput, state: Partial) { + public async updateBackend(input: MultiStepInput, _state: Partial) { if (this.toolchainEnv === undefined || this.toolchainType === undefined) { this.error = 'toolchainenv is undefined.'; throw Error('toolchainenv is undefined.');