Skip to content

Commit eadf2c9

Browse files
committed
Updated ESLint rules configuration and run --fix
Per https://typescript-eslint.io/blog/announcing-typescript-eslint-v6/
1 parent 8757d68 commit eadf2c9

9 files changed

+18
-18
lines changed

.eslintrc.json

+3-6
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,16 @@
55
},
66
"extends": [
77
"eslint:recommended",
8-
"plugin:@typescript-eslint/recommended",
9-
"plugin:@typescript-eslint/recommended-requiring-type-checking",
10-
"plugin:@typescript-eslint/strict"
8+
"plugin:@typescript-eslint/stylistic-type-checked",
9+
"plugin:@typescript-eslint/strict-type-checked"
1110
],
1211
"overrides": [],
1312
"parser": "@typescript-eslint/parser",
1413
"parserOptions": {
1514
"ecmaVersion": "latest",
1615
"sourceType": "module",
1716
"tsconfigRootDir": ".",
18-
"project": [
19-
"./tsconfig.json"
20-
]
17+
"project": true
2118
},
2219
"plugins": [
2320
"@typescript-eslint",

src/features/ExtensionCommands.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export class ExtensionCommandsFeature extends LanguageClientConsumer {
203203
this.handlers = [
204204
this.languageClient.onNotification(
205205
ExtensionCommandAddedNotificationType,
206-
(command) => this.addExtensionCommand(command)),
206+
(command) => { this.addExtensionCommand(command); }),
207207

208208
this.languageClient.onRequest(
209209
GetEditorContextRequestType,

src/features/GetCommands.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export class GetCommandsFeature extends LanguageClientConsumer {
3434
super();
3535
this.commands = [
3636
vscode.commands.registerCommand("PowerShell.RefreshCommandsExplorer",
37-
async () => await this.CommandExplorerRefresh()),
38-
vscode.commands.registerCommand("PowerShell.InsertCommand", async (item) => await this.InsertCommand(item))
37+
async () => { await this.CommandExplorerRefresh(); }),
38+
vscode.commands.registerCommand("PowerShell.InsertCommand", async (item) => { await this.InsertCommand(item); })
3939
];
4040
this.commandsExplorerProvider = new CommandsExplorerProvider();
4141

src/features/RemoteFiles.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class RemoteFilesFeature extends LanguageClientConsumer {
6969

7070
await vscode.window.showTextDocument(doc);
7171
await vscode.commands.executeCommand("workbench.action.closeActiveEditor");
72-
return await innerCloseFiles();
72+
await innerCloseFiles();
7373
}
7474

7575
void innerCloseFiles();

src/features/UpdatePowerShell.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ export class UpdatePowerShell {
156156
try {
157157
const tag = await this.maybeGetNewRelease();
158158
if (tag) {
159-
return await this.promptToUpdate(tag);
159+
await this.promptToUpdate(tag);
160+
return;
160161
}
161162
} catch (err) {
162163
// Best effort. This probably failed to fetch the data from GitHub.

src/process.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class PowerShellProcess {
114114
// all terminals and the event itself checks if it's our terminal). This
115115
// subscription should happen before we create the terminal so if it
116116
// fails immediately, the event fires.
117-
this.consoleCloseSubscription = vscode.window.onDidCloseTerminal((terminal) => this.onTerminalClose(terminal));
117+
this.consoleCloseSubscription = vscode.window.onDidCloseTerminal((terminal) => { this.onTerminalClose(terminal); });
118118
this.consoleTerminal = vscode.window.createTerminal(terminalOptions);
119119
this.pid = await this.getPid();
120120
this.logger.write(`PowerShell process started with PID: ${this.pid}`);

src/session.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ export class SessionManager implements Middleware {
155155
case SessionStatus.Starting:
156156
// A simple lock because this function isn't re-entrant.
157157
this.logger.writeWarning("Re-entered 'start' so waiting...");
158-
return await this.waitWhileStarting();
158+
await this.waitWhileStarting();
159+
return;
159160
case SessionStatus.Running:
160161
// We're started, just return.
161162
this.logger.writeVerbose("Already started.");

test/features/DebugSession.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,8 @@ describe("DebugSessionFeature E2E", () => {
489489

490490
const debugStarted = await debug.startDebugging(undefined, launchScriptConfig);
491491
assert.ok(debugStarted);
492-
const debugStopped = await debug.stopDebugging(undefined);
493-
assert.ok(debugStopped);
492+
493+
await debug.stopDebugging(undefined);
494494

495495
assert.ok(startDebugging.calledTwice);
496496
assert.ok(startDebugging.calledWith(undefined, launchScriptConfig));
@@ -531,11 +531,11 @@ describe("DebugSessionFeature E2E", () => {
531531
const dotnetDebugSession = await dotnetDebugSessionActive;
532532
console.log(debug.activeDebugSession);
533533
console.log(debug.breakpoints);
534-
const debugStopped = await debug.stopDebugging(undefined);
534+
535+
await debug.stopDebugging(undefined);
535536

536537
assert.ok(debugStarted);
537538
assert.ok(dotnetDebugSession);
538-
assert.ok(debugStopped);
539539
});
540540
});
541541
});

test/runTestsInner.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ function runTestsInner(testsRoot: string): Promise<void> {
6868
throw new Error(`${failures} tests failed.`);
6969
} else {
7070
console.log("\n\n=====\nTest Runner STOP\n=====");
71-
return c();
71+
c();
72+
return;
7273
}
7374
});
7475
} catch (err) {

0 commit comments

Comments
 (0)