Skip to content

Commit

Permalink
Updated ESLint rules configuration and run --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andyleejordan committed Jul 17, 2023
1 parent 8757d68 commit eadf2c9
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
9 changes: 3 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/strict"
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:@typescript-eslint/strict-type-checked"
],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"tsconfigRootDir": ".",
"project": [
"./tsconfig.json"
]
"project": true
},
"plugins": [
"@typescript-eslint",
Expand Down
2 changes: 1 addition & 1 deletion src/features/ExtensionCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export class ExtensionCommandsFeature extends LanguageClientConsumer {
this.handlers = [
this.languageClient.onNotification(
ExtensionCommandAddedNotificationType,
(command) => this.addExtensionCommand(command)),
(command) => { this.addExtensionCommand(command); }),

this.languageClient.onRequest(
GetEditorContextRequestType,
Expand Down
4 changes: 2 additions & 2 deletions src/features/GetCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export class GetCommandsFeature extends LanguageClientConsumer {
super();
this.commands = [
vscode.commands.registerCommand("PowerShell.RefreshCommandsExplorer",
async () => await this.CommandExplorerRefresh()),
vscode.commands.registerCommand("PowerShell.InsertCommand", async (item) => await this.InsertCommand(item))
async () => { await this.CommandExplorerRefresh(); }),
vscode.commands.registerCommand("PowerShell.InsertCommand", async (item) => { await this.InsertCommand(item); })
];
this.commandsExplorerProvider = new CommandsExplorerProvider();

Expand Down
2 changes: 1 addition & 1 deletion src/features/RemoteFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class RemoteFilesFeature extends LanguageClientConsumer {

await vscode.window.showTextDocument(doc);
await vscode.commands.executeCommand("workbench.action.closeActiveEditor");
return await innerCloseFiles();
await innerCloseFiles();
}

void innerCloseFiles();
Expand Down
3 changes: 2 additions & 1 deletion src/features/UpdatePowerShell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ export class UpdatePowerShell {
try {
const tag = await this.maybeGetNewRelease();
if (tag) {
return await this.promptToUpdate(tag);
await this.promptToUpdate(tag);
return;
}
} catch (err) {
// Best effort. This probably failed to fetch the data from GitHub.
Expand Down
2 changes: 1 addition & 1 deletion src/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class PowerShellProcess {
// all terminals and the event itself checks if it's our terminal). This
// subscription should happen before we create the terminal so if it
// fails immediately, the event fires.
this.consoleCloseSubscription = vscode.window.onDidCloseTerminal((terminal) => this.onTerminalClose(terminal));
this.consoleCloseSubscription = vscode.window.onDidCloseTerminal((terminal) => { this.onTerminalClose(terminal); });
this.consoleTerminal = vscode.window.createTerminal(terminalOptions);
this.pid = await this.getPid();
this.logger.write(`PowerShell process started with PID: ${this.pid}`);
Expand Down
3 changes: 2 additions & 1 deletion src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ export class SessionManager implements Middleware {
case SessionStatus.Starting:
// A simple lock because this function isn't re-entrant.
this.logger.writeWarning("Re-entered 'start' so waiting...");
return await this.waitWhileStarting();
await this.waitWhileStarting();
return;
case SessionStatus.Running:
// We're started, just return.
this.logger.writeVerbose("Already started.");
Expand Down
8 changes: 4 additions & 4 deletions test/features/DebugSession.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ describe("DebugSessionFeature E2E", () => {

const debugStarted = await debug.startDebugging(undefined, launchScriptConfig);
assert.ok(debugStarted);
const debugStopped = await debug.stopDebugging(undefined);
assert.ok(debugStopped);

await debug.stopDebugging(undefined);

assert.ok(startDebugging.calledTwice);
assert.ok(startDebugging.calledWith(undefined, launchScriptConfig));
Expand Down Expand Up @@ -531,11 +531,11 @@ describe("DebugSessionFeature E2E", () => {
const dotnetDebugSession = await dotnetDebugSessionActive;
console.log(debug.activeDebugSession);
console.log(debug.breakpoints);
const debugStopped = await debug.stopDebugging(undefined);

await debug.stopDebugging(undefined);

assert.ok(debugStarted);
assert.ok(dotnetDebugSession);
assert.ok(debugStopped);
});
});
});
3 changes: 2 additions & 1 deletion test/runTestsInner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ function runTestsInner(testsRoot: string): Promise<void> {
throw new Error(`${failures} tests failed.`);
} else {
console.log("\n\n=====\nTest Runner STOP\n=====");
return c();
c();
return;
}
});
} catch (err) {
Expand Down

0 comments on commit eadf2c9

Please sign in to comment.