Skip to content

Commit 58fca4c

Browse files
committed
Fix more tslint warnings
1 parent 381cbc1 commit 58fca4c

File tree

5 files changed

+278
-315
lines changed

5 files changed

+278
-315
lines changed

src/features/Examples.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
* Copyright (C) Microsoft Corporation. All rights reserved.
33
*--------------------------------------------------------*/
44

5-
import vscode = require('vscode');
6-
import path = require('path');
7-
import { IFeature } from '../feature';
8-
import { LanguageClient } from 'vscode-languageclient';
5+
import path = require("path");
6+
import vscode = require("vscode");
7+
import { LanguageClient } from "vscode-languageclient";
8+
import { IFeature } from "../feature";
99

1010
export class ExamplesFeature implements IFeature {
1111
private command: vscode.Disposable;
1212
private examplesPath: string;
1313

1414
constructor() {
1515
this.examplesPath = path.resolve(__dirname, "../../../examples");
16-
this.command = vscode.commands.registerCommand('PowerShell.OpenExamplesFolder', () => {
16+
this.command = vscode.commands.registerCommand("PowerShell.OpenExamplesFolder", () => {
1717
vscode.commands.executeCommand(
1818
"vscode.openFolder",
1919
vscode.Uri.file(this.examplesPath),
@@ -22,9 +22,10 @@ export class ExamplesFeature implements IFeature {
2222
}
2323

2424
public setLanguageClient(languageclient: LanguageClient) {
25+
// Eliminate tslint warning
2526
}
2627

2728
public dispose() {
2829
this.command.dispose();
2930
}
30-
}
31+
}

src/features/ExpandAlias.ts

+19-23
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,54 @@
22
* Copyright (C) Microsoft Corporation. All rights reserved.
33
*--------------------------------------------------------*/
44

5-
import vscode = require('vscode');
5+
import vscode = require("vscode");
66
import Window = vscode.window;
7-
import { IFeature } from '../feature';
8-
import { LanguageClient, RequestType, NotificationType } from 'vscode-languageclient';
7+
import { LanguageClient, NotificationType, RequestType } from "vscode-languageclient";
8+
import { IFeature } from "../feature";
99

10-
export namespace ExpandAliasRequest {
11-
export const type = new RequestType<string, any, void, void>('powerShell/expandAlias');
12-
}
10+
export const ExpandAliasRequestType = new RequestType<string, any, void, void>("powerShell/expandAlias");
1311

1412
export class ExpandAliasFeature implements IFeature {
1513
private command: vscode.Disposable;
1614
private languageClient: LanguageClient;
1715

1816
constructor() {
19-
this.command = vscode.commands.registerCommand('PowerShell.ExpandAlias', () => {
17+
this.command = vscode.commands.registerCommand("PowerShell.ExpandAlias", () => {
2018
if (this.languageClient === undefined) {
2119
// TODO: Log error message
2220
return;
2321
}
2422

25-
var editor = Window.activeTextEditor;
26-
var document = editor.document;
27-
var selection = editor.selection;
28-
var text, range;
23+
const editor = Window.activeTextEditor;
24+
const document = editor.document;
25+
const selection = editor.selection;
26+
const sls = selection.start;
27+
const sle = selection.end;
2928

30-
var sls = selection.start;
31-
var sle = selection.end;
29+
let text;
30+
let range;
3231

33-
if (
34-
(sls.character === sle.character) &&
35-
(sls.line === sle.line)
36-
) {
32+
if ((sls.character === sle.character) && (sls.line === sle.line)) {
3733
text = document.getText();
3834
range = new vscode.Range(0, 0, document.lineCount, text.length);
3935
} else {
4036
text = document.getText(selection);
4137
range = new vscode.Range(sls.line, sls.character, sle.line, sle.character);
4238
}
4339

44-
this.languageClient.sendRequest(ExpandAliasRequest.type, text).then((result) => {
40+
this.languageClient.sendRequest(ExpandAliasRequestType, text).then((result) => {
4541
editor.edit((editBuilder) => {
4642
editBuilder.replace(range, result);
4743
});
4844
});
4945
});
5046
}
5147

52-
public setLanguageClient(languageclient: LanguageClient) {
53-
this.languageClient = languageclient;
54-
}
55-
5648
public dispose() {
5749
this.command.dispose();
5850
}
59-
}
51+
52+
public setLanguageClient(languageclient: LanguageClient) {
53+
this.languageClient = languageclient;
54+
}
55+
}

0 commit comments

Comments
 (0)