diff --git a/.eslintrc.json b/.eslintrc.json index 5107e799..5985a9ff 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,9 +5,13 @@ "ecmaVersion": 6, "sourceType": "module" }, + "extends": [ + "eslint:recommended" + ], "plugins": [ "@typescript-eslint" ], + "env": {"node": true, "mocha": true}, "rules": { "@typescript-eslint/naming-convention": "warn", "@typescript-eslint/semi": "warn", diff --git a/src/Backend/Command.ts b/src/Backend/Command.ts index 9b0d39d2..b65eb1a2 100644 --- a/src/Backend/Command.ts +++ b/src/Backend/Command.ts @@ -39,6 +39,6 @@ class Command extends Array { str(): string { return (this.root ? 'sudo ' : '') + this.strs().join(' '); } -}; +} export {Command}; diff --git a/src/Backend/Compiler.ts b/src/Backend/Compiler.ts index f310c1aa..9af37e51 100644 --- a/src/Backend/Compiler.ts +++ b/src/Backend/Compiler.ts @@ -88,6 +88,6 @@ class CompilerBase implements Compiler { prerequisitesForGetToolchains(): Command { throw Error('Invalid prerequisitesForGetToolchains call'); } -}; +} export {Compiler, CompilerBase}; diff --git a/src/Backend/Executor.ts b/src/Backend/Executor.ts index a76885a7..213fdaca 100644 --- a/src/Backend/Executor.ts +++ b/src/Backend/Executor.ts @@ -57,6 +57,6 @@ class ExecutorBase implements Executor { require(): DeviceSpec { throw new Error('NYI: need to define DeviceSpec for Executor.'); } -}; +} export {Executor, ExecutorBase}; diff --git a/src/Backend/Toolchain.ts b/src/Backend/Toolchain.ts index db485432..006f25a5 100644 --- a/src/Backend/Toolchain.ts +++ b/src/Backend/Toolchain.ts @@ -70,6 +70,6 @@ class Toolchain { // TODO: How to handle `nightly`? // TODO: Support MinimumVersion(): >= // TODO: Support filter(), where(), filter(regex) or orderBy() -class Toolchains extends Array {}; +class Toolchains extends Array {} export {PackageInfo, ToolchainInfo, Toolchain, Toolchains}; diff --git a/src/Backend/ToolchainImpl/DebianToolchain.ts b/src/Backend/ToolchainImpl/DebianToolchain.ts index 902b604d..f94877c4 100644 --- a/src/Backend/ToolchainImpl/DebianToolchain.ts +++ b/src/Backend/ToolchainImpl/DebianToolchain.ts @@ -129,6 +129,6 @@ class DebianToolchain implements Toolchain { cmd.push(cfg); return cmd; } -}; +} export {DebianRepo, DebianArch, DebianToolchain}; diff --git a/src/Backend/Version.ts b/src/Backend/Version.ts index 8d62af44..fed4dead 100644 --- a/src/Backend/Version.ts +++ b/src/Backend/Version.ts @@ -47,6 +47,6 @@ class Version { } // TODO: Add operator <, <=, >, >= -}; +} export {Version}; diff --git a/src/CfgEditor/CfgEditorPanel.ts b/src/CfgEditor/CfgEditorPanel.ts index f7794134..1b2d7e53 100644 --- a/src/CfgEditor/CfgEditorPanel.ts +++ b/src/CfgEditor/CfgEditorPanel.ts @@ -67,7 +67,7 @@ export class CfgEditorPanel implements vscode.CustomTextEditorProvider { ]; registrations.forEach(disposable => context.subscriptions.push(disposable)); - }; + } constructor(private readonly context: vscode.ExtensionContext) {} @@ -78,7 +78,7 @@ export class CfgEditorPanel implements vscode.CustomTextEditorProvider { await this.initWebview(document, webviewPanel.webview); this.initWebviewPanel(document, webviewPanel); this.updateWebview(document, webviewPanel.webview); - }; + } private async initWebview(document: vscode.TextDocument, webview: vscode.Webview): Promise { webview.options = { @@ -195,5 +195,5 @@ export class CfgEditorPanel implements vscode.CustomTextEditorProvider { type: 'displayCfgToEditor', text: this._oneConfigMap[document.uri.toString()].getAsConfig() }); - }; + } } diff --git a/src/CircleGraph/CircleGraphCtrl.ts b/src/CircleGraph/CircleGraphCtrl.ts index 6c2015e3..b486f582 100644 --- a/src/CircleGraph/CircleGraphCtrl.ts +++ b/src/CircleGraph/CircleGraphCtrl.ts @@ -49,7 +49,7 @@ export class MessageDefs { public static readonly tensors = 'tensors'; // partiton of backends public static readonly partition = 'partition'; -}; +} export interface CircleGraphEvent { onPageLoaded(): void; diff --git a/src/CircleGraph/CircleViewer.ts b/src/CircleGraph/CircleViewer.ts index 579c7c3b..52b88eac 100644 --- a/src/CircleGraph/CircleViewer.ts +++ b/src/CircleGraph/CircleViewer.ts @@ -91,7 +91,7 @@ export class CircleViewerDocument implements vscode.CustomDocument { return view; } -}; +} /** * @brief Circle model viewer readonly Provider @@ -142,4 +142,4 @@ export class CircleViewerProvider implements _token: vscode.CancellationToken): Promise { document.openView(webviewPanel, this._context.extensionUri); } -}; +} diff --git a/src/Jsontracer/JsonTracerViewerPanel.ts b/src/Jsontracer/JsonTracerViewerPanel.ts index 7b9b0f71..c1c7844d 100644 --- a/src/Jsontracer/JsonTracerViewerPanel.ts +++ b/src/Jsontracer/JsonTracerViewerPanel.ts @@ -63,7 +63,7 @@ export class JsonTracerViewerPanel implements vscode.CustomTextEditorProvider { ]; registrations.forEach(disposable => context.subscriptions.push(disposable)); - }; + } constructor(private readonly context: vscode.ExtensionContext) {} @@ -73,7 +73,7 @@ export class JsonTracerViewerPanel implements vscode.CustomTextEditorProvider { await this.initWebview(document, webviewPanel.webview); this.initWebviewPanel(document, webviewPanel); this.updateWebview(document, webviewPanel.webview); - }; + } private async initWebview(document: vscode.TextDocument, webview: vscode.Webview): Promise { webview.options = { @@ -137,5 +137,5 @@ export class JsonTracerViewerPanel implements vscode.CustomTextEditorProvider { if (content !== undefined) { webview.postMessage({type: 'load', content: content, displayTimeUnit: displayTimeUnit}); } - }; + } } diff --git a/src/OneExplorer/ArtifactLocator.ts b/src/OneExplorer/ArtifactLocator.ts index 2106f9f6..74db54d8 100644 --- a/src/OneExplorer/ArtifactLocator.ts +++ b/src/OneExplorer/ArtifactLocator.ts @@ -190,7 +190,7 @@ export class Locator { return filePaths; } -}; +} // TODO Move to backend side with some modification diff --git a/src/OneExplorer/ConfigObject.ts b/src/OneExplorer/ConfigObject.ts index f6fa3f45..9d66a41a 100644 --- a/src/OneExplorer/ConfigObject.ts +++ b/src/OneExplorer/ConfigObject.ts @@ -290,4 +290,4 @@ export class ConfigObj { return artifacts; }; -}; +} diff --git a/src/OneExplorer/OneExplorer.ts b/src/OneExplorer/OneExplorer.ts index d1d509a8..24235b1f 100644 --- a/src/OneExplorer/OneExplorer.ts +++ b/src/OneExplorer/OneExplorer.ts @@ -752,4 +752,4 @@ input_path=${modelName}.${extName} return this.tree; } -}; +} diff --git a/src/PartEditor/PartEditor.ts b/src/PartEditor/PartEditor.ts index 3cdcd3a1..9cd54a28 100644 --- a/src/PartEditor/PartEditor.ts +++ b/src/PartEditor/PartEditor.ts @@ -379,7 +379,7 @@ export class PartEditorProvider implements vscode.CustomTextEditorProvider, Part ]; registrations.forEach(disposable => context.subscriptions.push(disposable)); - }; + } constructor(private readonly context: vscode.ExtensionContext) { this._extensionUri = context.extensionUri; @@ -451,4 +451,4 @@ export class PartEditorProvider implements vscode.CustomTextEditorProvider, Part [vscode.Uri.joinPath(extensionUri, PartEditorProvider.folderMediaPartEditor)] }; } -}; +} diff --git a/src/PartEditor/PartGraphSelector.ts b/src/PartEditor/PartGraphSelector.ts index 1a89a970..9a9647c3 100644 --- a/src/PartEditor/PartGraphSelector.ts +++ b/src/PartEditor/PartGraphSelector.ts @@ -98,7 +98,7 @@ export class PartGraphSelPanel extends CircleGraphCtrl implements CircleGraphEve ]; registrations.forEach(disposable => context.subscriptions.push(disposable)); - }; + } public static createOrShow( extensionUri: vscode.Uri, args: PartGraphCmdOpenArgs, handler: PartGraphEvent|undefined) { @@ -286,4 +286,4 @@ export class PartGraphSelPanel extends CircleGraphCtrl implements CircleGraphEve let content = ini.parse(this._documentText); this.setPartition(content); } -}; +} diff --git a/src/Tests/OneExplorer/ConfigObject.test.ts b/src/Tests/OneExplorer/ConfigObject.test.ts index bab9fb55..875dbe9c 100644 --- a/src/Tests/OneExplorer/ConfigObject.test.ts +++ b/src/Tests/OneExplorer/ConfigObject.test.ts @@ -73,7 +73,7 @@ class TestBuilder { console.log(`Test ${this.testLabel} - Done`); } } -}; +} suite('OneExplorer', function() { suite('ConfigObject', function() { @@ -446,7 +446,7 @@ output_path=/dummy/dummy/../..//${productName2} configObj?.getProducts.map(product => product.path).includes(productPath1)); assert.isFalse( configObj?.getProducts.map(product => product.path).includes(productPath2)); - ; + } }); diff --git a/src/Tests/OneExplorer/OneExplorer.test.ts b/src/Tests/OneExplorer/OneExplorer.test.ts index 512aece5..5a4eca7c 100644 --- a/src/Tests/OneExplorer/OneExplorer.test.ts +++ b/src/Tests/OneExplorer/OneExplorer.test.ts @@ -133,7 +133,7 @@ class TestBuilder { console.log(`Removed ${TestBuilder.rootInTemp} and ${TestBuilder.rootInTemp}.`); } } -}; +} suite('OneExplorer', function() { setup(() => TestBuilder.setUp()); diff --git a/src/Tests/OneExplorer/OneStorage.test.ts b/src/Tests/OneExplorer/OneStorage.test.ts index dbc23184..0fe0827a 100644 --- a/src/Tests/OneExplorer/OneStorage.test.ts +++ b/src/Tests/OneExplorer/OneStorage.test.ts @@ -132,7 +132,7 @@ class TestBuilder { console.log(`Removed ${TestBuilder.rootInTemp} and ${TestBuilder.rootInTemp}.`); } } -}; +} suite('OneExplorer', function() { suite('OneStorage', function() { diff --git a/src/View/InstallQuickInput.ts b/src/View/InstallQuickInput.ts index 582ea672..fe016449 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) { if (this.toolchainEnv === undefined || this.toolchainType === undefined) { this.error = 'toolchainenv is undefined.'; throw Error('toolchainenv is undefined.');