From 389e7560877c47566bd0654310df73628763fa07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Podsiad=C5=82o?= <37124721+kpodsiad@users.noreply.github.com> Date: Wed, 12 Jan 2022 13:19:45 +0100 Subject: [PATCH] Fix eslint error & CI check (#816) --- .github/workflows/ci.yml | 2 +- package.json | 2 +- src/extension.ts | 4 +++- src/scalaDebugger.ts | 6 ++++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99b0327c2..7f3fea3f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,4 +48,4 @@ jobs: with: node-version: "14" - run: yarn install - - run: yarn eslint + - run: yarn eslint . diff --git a/package.json b/package.json index 86f7c2a31..830466460 100644 --- a/package.json +++ b/package.json @@ -828,7 +828,7 @@ "build": "vsce package --yarn", "vscode:publish": "vsce publish --yarn", "ovsx:publish": "ovsx publish", - "lint": "eslint . --ext .ts --fix", + "lint": "eslint . --ext .ts --fix && yarn format", "format": "prettier --write '**/*.{ts,js,json,yml}'", "format-check": "prettier --check '**/*.{ts,js,json,yml}'" }, diff --git a/src/extension.ts b/src/extension.ts index 9a413bafa..13aee5062 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -854,7 +854,9 @@ function launchMetals( registerCommand( `metals.${ServerCommands.GotoPosition}`, (location: Location) => { - if (location) gotoLocation(location, false); + if (location) { + gotoLocation(location, false); + } } ); diff --git a/src/scalaDebugger.ts b/src/scalaDebugger.ts index a3d2b0a5e..b322dd167 100644 --- a/src/scalaDebugger.ts +++ b/src/scalaDebugger.ts @@ -67,7 +67,7 @@ class ScalaMainConfigProvider implements vscode.DebugConfigurationProvider { _folder: WorkspaceFolder | undefined, debugConfiguration: DebugConfiguration ): ProviderResult { - let editor = vscode.window.activeTextEditor; + const editor = vscode.window.activeTextEditor; // debugConfiguration.type is undefined if there are no configurations // we are running whatever is in the file if (debugConfiguration.type === undefined && editor) { @@ -94,7 +94,9 @@ class ScalaMainConfigProvider implements vscode.DebugConfigurationProvider { commands.executeCommand("workbench.panel.repl.view.focus"); return configuration; }); - } else return debugConfiguration; + } else { + return debugConfiguration; + } } }