Skip to content

Commit df1ee46

Browse files
authored
Enable noImplicitReturn & noUnusedParameters (#514)
1 parent c5cdb71 commit df1ee46

File tree

13 files changed

+36
-32
lines changed

13 files changed

+36
-32
lines changed

src/commands/handler.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { sendInfo } from "vscode-extension-telemetry-wrapper";
88
import { getReleaseNotesEntries, findLatestReleaseNotes } from "../utils";
99
import { gt, eq } from "semver";
1010

11-
export async function createMavenProjectCmdHandler(context: vscode.ExtensionContext) {
11+
export async function createMavenProjectCmdHandler(_context: vscode.ExtensionContext) {
1212
if (!await validateAndRecommendExtension("vscjava.vscode-maven", "Maven extension is recommended to help create Java projects and work with custom goals.", true)) {
1313
return;
1414
}
@@ -18,23 +18,23 @@ export async function createMavenProjectCmdHandler(context: vscode.ExtensionCont
1818

1919
// TODO: add entry to create standalone Java file
2020

21-
export async function createSpringBootProjectCmdHandler(context: vscode.ExtensionContext) {
21+
export async function createSpringBootProjectCmdHandler(_context: vscode.ExtensionContext) {
2222
if (!await validateAndRecommendExtension("vscjava.vscode-spring-initializr", "Spring Initializr extension is recommended to help create Spring Boot projects and manage dependencies.", true)) {
2323
return;
2424
}
2525

2626
await vscode.commands.executeCommand("spring.initializr.createProject");
2727
}
2828

29-
export async function createQuarkusProjectCmdHandler(context: vscode.ExtensionContext) {
29+
export async function createQuarkusProjectCmdHandler(_context: vscode.ExtensionContext) {
3030
if (!await validateAndRecommendExtension("redhat.vscode-quarkus", "Quarkus Tools for Visual Studio Code is recommended to help create Quarkus projects and for an all-in-one Quarkus application development experience.", true)) {
3131
return;
3232
}
3333

3434
await vscode.commands.executeCommand("quarkusTools.createProject");
3535
}
3636

37-
export async function createMicroProfileStarterProjectCmdHandler(context: vscode.ExtensionContext) {
37+
export async function createMicroProfileStarterProjectCmdHandler(_context: vscode.ExtensionContext) {
3838
if (!await validateAndRecommendExtension("microProfile-community.mp-starter-vscode-ext", "MicroProfile Starter for Visual Studio Code is recommended to generate starter projects for Eclipse MicroProfile.", true)) {
3939
return;
4040
}
@@ -43,26 +43,26 @@ export async function createMicroProfileStarterProjectCmdHandler(context: vscode
4343
}
4444

4545

46-
export async function showExtensionCmdHandler(context: vscode.ExtensionContext, operationId: string, extensionName: string) {
46+
export async function showExtensionCmdHandler(_context: vscode.ExtensionContext, operationId: string, extensionName: string) {
4747
sendInfo(operationId, { extName: extensionName });
4848
vscode.commands.executeCommand("extension.open", extensionName);
4949
}
5050

51-
export async function installExtensionCmdHandler(context: vscode.ExtensionContext, operationId: string, extensionName: string, displayName: string) {
51+
export async function installExtensionCmdHandler(_context: vscode.ExtensionContext, operationId: string, extensionName: string, displayName: string) {
5252
sendInfo(operationId, { extName: extensionName });
53-
return vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: `Installing ${displayName||extensionName}...`}, progress => {
53+
return vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: `Installing ${displayName||extensionName}...`}, _progress => {
5454
return vscode.commands.executeCommand("workbench.extensions.installExtension", extensionName);
5555
}).then(() => {
5656
vscode.window.showInformationMessage(`Successfully installed ${displayName||extensionName}.`);
5757
});
5858
}
5959

60-
export async function openUrlCmdHandler(context: vscode.ExtensionContext, operationId: string, url: string) {
60+
export async function openUrlCmdHandler(_context: vscode.ExtensionContext, operationId: string, url: string) {
6161
sendInfo(operationId, { url: url });
6262
vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(url));
6363
}
6464

65-
export async function showReleaseNotes(context: vscode.ExtensionContext, operationId: string, version: string) {
65+
export async function showReleaseNotes(context: vscode.ExtensionContext, _operationId: string, version: string) {
6666
let path = context.asAbsolutePath(`release-notes/v${version}.md`);
6767
vscode.commands.executeCommand("markdown.showPreview", vscode.Uri.file(path), null, {
6868
sideBySide: false,

src/ext-guide/assets/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ window.addEventListener("message", event => {
8080
});
8181

8282
function syncExtensionStatus(extensions: string[]) {
83-
$("input[type='checkbox']").each((i, elem) => {
83+
$("input[type='checkbox']").each((_i, elem) => {
8484
const isInstalled = extensions.includes(<string>$(elem).val());
8585
$(elem).prop("disabled", isInstalled);
8686
$(elem).prop("checked", isInstalled);
@@ -90,7 +90,7 @@ function syncExtensionStatus(extensions: string[]) {
9090
function getSelectedExtension(isAll: boolean = false) {
9191
const $selected = isAll ? $("input:visible:enabled") : $("input:checked:visible:enabled");
9292
const selectedExtensions: string[] = [];
93-
$selected.each((i, elem) => { selectedExtensions.push(<string>$(elem).val()); });
93+
$selected.each((_i, elem) => { selectedExtensions.push(<string>$(elem).val()); });
9494
return selectedExtensions;
9595
}
9696

src/ext-guide/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async function initializeJavaExtGuideView(context: vscode.ExtensionContext, webv
5050
}
5151
}));
5252

53-
vscode.extensions.onDidChange(e => {
53+
vscode.extensions.onDidChange(_e => {
5454
syncExtensionStatus();
5555
});
5656

@@ -66,7 +66,7 @@ async function initializeJavaExtGuideView(context: vscode.ExtensionContext, webv
6666
}
6767

6868
export class JavaExtGuideViewSerializer implements vscode.WebviewPanelSerializer {
69-
async deserializeWebviewPanel(webviewPanel: vscode.WebviewPanel, state: any) {
69+
async deserializeWebviewPanel(webviewPanel: vscode.WebviewPanel, _state: any) {
7070
if (javaExtGuideView) {
7171
javaExtGuideView.reveal();
7272
webviewPanel.dispose();

src/extension.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export async function activate(context: vscode.ExtensionContext) {
1919
await instrumentOperation("activation", initializeExtension)(context);
2020
}
2121

22-
async function initializeExtension(operationId: string, context: vscode.ExtensionContext) {
22+
async function initializeExtension(_operationId: string, context: vscode.ExtensionContext) {
2323
initUtils(context);
2424
initCommands(context);
2525
initRecommendations(context);
@@ -71,7 +71,7 @@ async function showExtensionGuide(context: vscode.ExtensionContext) {
7171
context.globalState.update("isExtensionGuidePresented", true);
7272
}
7373

74-
async function showGettingStartedView(context: vscode.ExtensionContext, isForce: boolean = false) {
74+
async function showGettingStartedView(context: vscode.ExtensionContext, _isForce: boolean = false) {
7575
if (!!context.globalState.get("isGettingStartedPresented")) {
7676
return;
7777
}
@@ -80,7 +80,7 @@ async function showGettingStartedView(context: vscode.ExtensionContext, isForce:
8080
context.globalState.update("isGettingStartedPresented", true);
8181
}
8282

83-
function initializeTelemetry(context: vscode.ExtensionContext) {
83+
function initializeTelemetry(_context: vscode.ExtensionContext) {
8484
const ext = vscode.extensions.getExtension("vscjava.vscode-java-pack");
8585
const packageInfo = ext ? ext.packageJSON : undefined;
8686
if (packageInfo) {

src/getting-started/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async function initializeJavaGettingStartedView(context: vscode.ExtensionContext
6161
}
6262

6363
export class JavaGettingStartedViewSerializer implements vscode.WebviewPanelSerializer {
64-
async deserializeWebviewPanel(webviewPanel: vscode.WebviewPanel, state: any) {
64+
async deserializeWebviewPanel(webviewPanel: vscode.WebviewPanel, _state: any) {
6565
if (javaGettingStartedView) {
6666
javaGettingStartedView.reveal();
6767
webviewPanel.dispose();

src/java-runtime/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { pathExists } from "fs-extra";
1616
let javaRuntimeView: vscode.WebviewPanel | undefined;
1717
let javaHomes: JavaRuntime[];
1818

19-
export async function javaRuntimeCmdHandler(context: vscode.ExtensionContext, operationId: string) {
19+
export async function javaRuntimeCmdHandler(context: vscode.ExtensionContext, _operationId: string) {
2020
if (javaRuntimeView) {
2121
javaRuntimeView.reveal();
2222
return;
@@ -151,7 +151,7 @@ async function initializeJavaRuntimeView(context: vscode.ExtensionContext, webvi
151151
}
152152

153153
export class JavaRuntimeViewSerializer implements vscode.WebviewPanelSerializer {
154-
async deserializeWebviewPanel(webviewPanel: vscode.WebviewPanel, state: any) {
154+
async deserializeWebviewPanel(webviewPanel: vscode.WebviewPanel, _state: any) {
155155
if (javaRuntimeView) {
156156
javaRuntimeView.reveal();
157157
webviewPanel.dispose();

src/java-runtime/utils/findJavaRuntime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,9 @@ async function checkVersionByCLI(javaHome: string): Promise<number> {
339339
if (!javaHome) {
340340
return 0;
341341
}
342-
return new Promise((resolve, reject) => {
342+
return new Promise((resolve, _reject) => {
343343
const javaBin = path.join(javaHome, "bin", JAVA_FILENAME);
344-
cp.execFile(javaBin, ["-version"], {}, (error, stdout, stderr) => {
344+
cp.execFile(javaBin, ["-version"], {}, (_error, _stdout, stderr) => {
345345
const regexp = /version "(.*)"/g;
346346
const match = regexp.exec(stderr);
347347
if (!match) {

src/misc/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ export async function showReleaseNotesOnStart(context: vscode.ExtensionContext)
5151
context.globalState.update(RELEASE_NOTE_PRESENTATION_HISTORY, history);
5252
}
5353

54-
export function initialize(context: vscode.ExtensionContext) {
54+
export function initialize(_context: vscode.ExtensionContext) {
5555
showInfoButton();
5656
}

src/overview/assets/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ window.addEventListener("message", event => {
1515
});
1616

1717
function syncExtensionVisibility(extensions: any) {
18-
$("div[ext]").each((index, elem) => {
18+
$("div[ext]").each((_index, elem) => {
1919
const anchor = $(elem);
2020
const ext = (anchor.attr("ext") || "").toLowerCase();
2121
if (extensions.indexOf(ext) !== -1) {
@@ -27,7 +27,7 @@ function syncExtensionVisibility(extensions: any) {
2727
}
2828

2929
function syncSectionVisibility() {
30-
$("div h3").parent().each((i, div) => {
30+
$("div h3").parent().each((_i, div) => {
3131
if (!$(div).children("h3 ~ div").is(":visible")) {
3232
$(div).hide();
3333
} else {

src/overview/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const toggleOverviewVisibilityOperation = instrumentOperation("toggleOverviewVis
2121
context.globalState.update(KEY_SHOW_WHEN_USING_JAVA, visibility);
2222
});
2323

24-
export async function overviewCmdHandler(context: vscode.ExtensionContext, operationId: string, showInBackground: boolean = false) {
24+
export async function overviewCmdHandler(context: vscode.ExtensionContext, _operationId: string, showInBackground: boolean = false) {
2525
if (overviewView) {
2626
overviewView.reveal();
2727
return;
@@ -67,7 +67,7 @@ async function initializeOverviewView(context: vscode.ExtensionContext, webviewP
6767

6868
syncExtensionVisibility();
6969

70-
vscode.extensions.onDidChange(e => {
70+
vscode.extensions.onDidChange(_e => {
7171
syncExtensionVisibility();
7272
});
7373

@@ -105,7 +105,7 @@ export async function showOverviewPageOnActivation(context: vscode.ExtensionCont
105105
}
106106

107107
export class OverviewViewSerializer implements vscode.WebviewPanelSerializer {
108-
async deserializeWebviewPanel(webviewPanel: vscode.WebviewPanel, state: any) {
108+
async deserializeWebviewPanel(webviewPanel: vscode.WebviewPanel, _state: any) {
109109
if (overviewView) {
110110
overviewView.reveal();
111111
webviewPanel.dispose();

0 commit comments

Comments
 (0)