Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use eslint:recommended #1252

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/Backend/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ class Command extends Array<string> {
str(): string {
return (this.root ? 'sudo ' : '') + this.strs().join(' ');
}
};
}

export {Command};
2 changes: 1 addition & 1 deletion src/Backend/Compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ class CompilerBase implements Compiler {
prerequisitesForGetToolchains(): Command {
throw Error('Invalid prerequisitesForGetToolchains call');
}
};
}

export {Compiler, CompilerBase};
2 changes: 1 addition & 1 deletion src/Backend/Executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ class ExecutorBase implements Executor {
require(): DeviceSpec {
throw new Error('NYI: need to define DeviceSpec for Executor.');
}
};
}

export {Executor, ExecutorBase};
2 changes: 1 addition & 1 deletion src/Backend/Toolchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Toolchain> {};
class Toolchains extends Array<Toolchain> {}

export {PackageInfo, ToolchainInfo, Toolchain, Toolchains};
2 changes: 1 addition & 1 deletion src/Backend/ToolchainImpl/DebianToolchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@ class DebianToolchain implements Toolchain {
cmd.push(cfg);
return cmd;
}
};
}

export {DebianRepo, DebianArch, DebianToolchain};
2 changes: 1 addition & 1 deletion src/Backend/Version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ class Version {
}

// TODO: Add operator <, <=, >, >=
};
}

export {Version};
6 changes: 3 additions & 3 deletions src/CfgEditor/CfgEditorPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class CfgEditorPanel implements vscode.CustomTextEditorProvider {
];

registrations.forEach(disposable => context.subscriptions.push(disposable));
};
}

constructor(private readonly context: vscode.ExtensionContext) {}

Expand All @@ -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<void> {
webview.options = {
Expand Down Expand Up @@ -195,5 +195,5 @@ export class CfgEditorPanel implements vscode.CustomTextEditorProvider {
type: 'displayCfgToEditor',
text: this._oneConfigMap[document.uri.toString()].getAsConfig()
});
};
}
}
2 changes: 1 addition & 1 deletion src/CircleGraph/CircleGraphCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/CircleGraph/CircleViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class CircleViewerDocument implements vscode.CustomDocument {

return view;
}
};
}

/**
* @brief Circle model viewer readonly Provider
Expand Down Expand Up @@ -142,4 +142,4 @@ export class CircleViewerProvider implements
_token: vscode.CancellationToken): Promise<void> {
document.openView(webviewPanel, this._context.extensionUri);
}
};
}
6 changes: 3 additions & 3 deletions src/Jsontracer/JsonTracerViewerPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class JsonTracerViewerPanel implements vscode.CustomTextEditorProvider {
];

registrations.forEach(disposable => context.subscriptions.push(disposable));
};
}

constructor(private readonly context: vscode.ExtensionContext) {}

Expand All @@ -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<void> {
webview.options = {
Expand Down Expand Up @@ -137,5 +137,5 @@ export class JsonTracerViewerPanel implements vscode.CustomTextEditorProvider {
if (content !== undefined) {
webview.postMessage({type: 'load', content: content, displayTimeUnit: displayTimeUnit});
}
};
}
}
2 changes: 1 addition & 1 deletion src/OneExplorer/ArtifactLocator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class Locator {

return filePaths;
}
};
}


// TODO Move to backend side with some modification
Expand Down
2 changes: 1 addition & 1 deletion src/OneExplorer/ConfigObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,4 +290,4 @@ export class ConfigObj {

return artifacts;
};
};
}
2 changes: 1 addition & 1 deletion src/OneExplorer/OneExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -752,4 +752,4 @@ input_path=${modelName}.${extName}

return this.tree;
}
};
}
4 changes: 2 additions & 2 deletions src/PartEditor/PartEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -451,4 +451,4 @@ export class PartEditorProvider implements vscode.CustomTextEditorProvider, Part
[vscode.Uri.joinPath(extensionUri, PartEditorProvider.folderMediaPartEditor)]
};
}
};
}
4 changes: 2 additions & 2 deletions src/PartEditor/PartGraphSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -286,4 +286,4 @@ export class PartGraphSelPanel extends CircleGraphCtrl implements CircleGraphEve
let content = ini.parse(this._documentText);
this.setPartition(content);
}
};
}
4 changes: 2 additions & 2 deletions src/Tests/OneExplorer/ConfigObject.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class TestBuilder {
console.log(`Test ${this.testLabel} - Done`);
}
}
};
}

suite('OneExplorer', function() {
suite('ConfigObject', function() {
Expand Down Expand Up @@ -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));
;

}
});

Expand Down
2 changes: 1 addition & 1 deletion src/Tests/OneExplorer/OneExplorer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class TestBuilder {
console.log(`Removed ${TestBuilder.rootInTemp} and ${TestBuilder.rootInTemp}.`);
}
}
};
}

suite('OneExplorer', function() {
setup(() => TestBuilder.setUp());
Expand Down
2 changes: 1 addition & 1 deletion src/Tests/OneExplorer/OneStorage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class TestBuilder {
console.log(`Removed ${TestBuilder.rootInTemp} and ${TestBuilder.rootInTemp}.`);
}
}
};
}

suite('OneExplorer', function() {
suite('OneStorage', function() {
Expand Down
4 changes: 2 additions & 2 deletions src/View/InstallQuickInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>(
(resolve, reject) => {
() => {
// noop
});
}
Expand Down Expand Up @@ -268,7 +268,7 @@ class InstallQuickInput {
}

/* istanbul ignore next */
public async updateBackend(input: MultiStepInput, state: Partial<InstallQuickInputState>) {
public async updateBackend(input: MultiStepInput) {
if (this.toolchainEnv === undefined || this.toolchainType === undefined) {
this.error = 'toolchainenv is undefined.';
throw Error('toolchainenv is undefined.');
Expand Down