Skip to content

Ci/vood 48 use recommended linting rules #9

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

Merged
Merged
27 changes: 21 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"extends": ["prettier"],
"$schema": "https://json.schemastore.org/eslintrc",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier"
],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"parserOptions": {
"project": ["./tsconfig.json"]
}
}
],
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
Expand All @@ -8,11 +22,12 @@
},
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/naming-convention": "error",
"@typescript-eslint/semi": "error",
"curly": "error",
"eqeqeq": "error",
"no-throw-literal": "error",
"semi": "off"
},
"ignorePatterns": ["out", "dist", "**/*.d.ts"]
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json.schemastore.org/prettierrc",
"$schema": "https://json.schemastore.org/prettierrc",
"printWidth": 140,
"singleQuote": true
}
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { commands, ExtensionContext } from 'vscode';
import { DebuggerPanel } from './webview/debugger-panel';
import { VisjsPanelView } from './webview/panel-views/visjs-panel-view';

export function activate(context: ExtensionContext) {
export function activate(context: ExtensionContext): void {
new Extension(context);
}

export function deactivate() {}
export function deactivate(): void {
// Do nothing
}

class Extension {
private debuggerPanel: DebuggerPanel;
Expand Down
4 changes: 2 additions & 2 deletions src/test/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as path from 'path';

import { runTests } from '@vscode/test-electron';

async function main() {
async function main(): Promise<void> {
try {
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
Expand All @@ -20,4 +20,4 @@ async function main() {
}
}

main();
void main();
2 changes: 1 addition & 1 deletion src/test/suite/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as vscode from 'vscode';
// import * as myExtension from '../../extension';

suite('Extension Test Suite', () => {
vscode.window.showInformationMessage('Start all tests.');
void vscode.window.showInformationMessage('Start all tests.');

test('Sample test', () => {
assert.strictEqual(-1, [1, 2, 3].indexOf(5));
Expand Down
2 changes: 1 addition & 1 deletion src/webview/debugger-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class DebuggerPanel {

this.viewPanel.webview.html = this.panelViewProxy.getHtml();

this.viewPanel.webview.postMessage(this.panelViewProxy.updatePanel());
void this.viewPanel.webview.postMessage(this.panelViewProxy.updatePanel());
}

private teardownPanel(): void {
Expand Down
2 changes: 1 addition & 1 deletion src/webview/panel-views/panel-view-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export interface PanelViewProxy {
}

export interface UpdatePanelViewCommand {
[key: string]: any;
[key: string]: unknown;
command: string;
}