Skip to content

Commit c853b04

Browse files
Merge pull request #906 from DustinCampbell/tslint-cleanup
Get clean on tslint warnings
2 parents 26e2d12 + 36077f8 commit c853b04

File tree

15 files changed

+58
-99
lines changed

15 files changed

+58
-99
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
],
2020
"main": "./out/src/main",
2121
"scripts": {
22-
"compile": "node ./node_modules/vscode/bin/compile -p ./",
22+
"compile": "node ./node_modules/vscode/bin/compile -p ./ && gulp tslint",
2323
"watch": "node ./node_modules/vscode/bin/compile -watch -p ./",
2424
"test": "mocha --timeout 15000 -u tdd ./out/test/*.tests.js ./out/test/**/*.tests.js",
2525
"postinstall": "node ./node_modules/vscode/bin/install"

src/assets.ts

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,45 @@ import * as vscode from 'vscode';
1111
import * as tasks from 'vscode-tasks';
1212
import {OmnisharpServer} from './omnisharp/server';
1313
import * as serverUtils from './omnisharp/utils';
14-
import * as protocol from './omnisharp/protocol'
14+
import * as protocol from './omnisharp/protocol';
1515

1616
interface DebugConfiguration {
17-
name: string,
18-
type: string,
19-
request: string,
20-
internalConsoleOptions?: string,
21-
sourceFileMap?: any,
17+
name: string;
18+
type: string;
19+
request: string;
20+
internalConsoleOptions?: string;
21+
sourceFileMap?: any;
2222
}
2323

2424
interface ConsoleLaunchConfiguration extends DebugConfiguration {
25-
preLaunchTask: string,
26-
program: string,
27-
args: string[],
28-
cwd: string,
29-
stopAtEntry: boolean,
30-
env?: any,
31-
externalConsole?: boolean
25+
preLaunchTask: string;
26+
program: string;
27+
args: string[];
28+
cwd: string;
29+
stopAtEntry: boolean;
30+
env?: any;
31+
externalConsole?: boolean;
3232
}
3333

3434
interface CommandLine {
35-
command: string,
36-
args?: string
35+
command: string;
36+
args?: string;
3737
}
3838

3939
interface LaunchBrowserConfiguration {
40-
enabled: boolean,
41-
args: string,
42-
windows?: CommandLine,
43-
osx: CommandLine,
44-
linux: CommandLine
40+
enabled: boolean;
41+
args: string;
42+
windows?: CommandLine;
43+
osx: CommandLine;
44+
linux: CommandLine;
4545
}
4646

4747
interface WebLaunchConfiguration extends ConsoleLaunchConfiguration {
48-
launchBrowser: LaunchBrowserConfiguration
48+
launchBrowser: LaunchBrowserConfiguration;
4949
}
5050

5151
interface AttachConfiguration extends DebugConfiguration {
52-
processId: string
52+
processId: string;
5353
}
5454

5555
interface Paths {
@@ -65,13 +65,13 @@ function getPaths(): Paths {
6565
vscodeFolder: vscodeFolder,
6666
tasksJsonPath: path.join(vscodeFolder, 'tasks.json'),
6767
launchJsonPath: path.join(vscodeFolder, 'launch.json')
68-
}
68+
};
6969
}
7070

7171
interface Operations {
72-
addTasksJson?: boolean,
73-
updateTasksJson?: boolean,
74-
addLaunchJson?: boolean
72+
addTasksJson?: boolean;
73+
updateTasksJson?: boolean;
74+
addLaunchJson?: boolean;
7575
}
7676

7777
function hasOperations(operations: Operations) {
@@ -127,13 +127,13 @@ enum PromptResult {
127127
}
128128

129129
interface PromptItem extends vscode.MessageItem {
130-
result: PromptResult
130+
result: PromptResult;
131131
}
132132

133133
function promptToAddAssets() {
134134
return new Promise<PromptResult>((resolve, reject) => {
135135
const yesItem: PromptItem = { title: 'Yes', result: PromptResult.Yes };
136-
const noItem: PromptItem = { title: 'Not Now', result: PromptResult.No, isCloseAffordance: true }
136+
const noItem: PromptItem = { title: 'Not Now', result: PromptResult.No, isCloseAffordance: true };
137137
const disableItem: PromptItem = { title: "Don't Ask Again", result: PromptResult.Disable };
138138

139139
const projectName = path.basename(vscode.workspace.rootPath);
@@ -147,7 +147,7 @@ function promptToAddAssets() {
147147
function computeProgramPath(projectData: TargetProjectData) {
148148
if (!projectData) {
149149
// If there's no target project data, use a placeholder for the path.
150-
return '${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>'
150+
return '${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>';
151151
}
152152

153153
let result = '${workspaceRoot}';
@@ -173,7 +173,7 @@ function createLaunchConfiguration(projectData: TargetProjectData): ConsoleLaunc
173173
externalConsole: false,
174174
stopAtEntry: false,
175175
internalConsoleOptions: "openOnSessionStart"
176-
}
176+
};
177177
}
178178

179179
function createWebLaunchConfiguration(projectData: TargetProjectData): WebLaunchConfiguration {
@@ -207,7 +207,7 @@ function createWebLaunchConfiguration(projectData: TargetProjectData): WebLaunch
207207
sourceFileMap: {
208208
"/Views": "${workspaceRoot}/Views"
209209
}
210-
}
210+
};
211211
}
212212

213213
function createAttachConfiguration(): AttachConfiguration {
@@ -216,7 +216,7 @@ function createAttachConfiguration(): AttachConfiguration {
216216
type: 'coreclr',
217217
request: 'attach',
218218
processId: "${command.pickProcess}"
219-
}
219+
};
220220
}
221221

222222
function createLaunchJson(projectData: TargetProjectData, isWebProject: boolean): any {
@@ -228,7 +228,7 @@ function createLaunchJson(projectData: TargetProjectData, isWebProject: boolean)
228228
createLaunchConfiguration(projectData),
229229
createAttachConfiguration()
230230
]
231-
}
231+
};
232232
}
233233
else {
234234
return {
@@ -237,7 +237,7 @@ function createLaunchJson(projectData: TargetProjectData, isWebProject: boolean)
237237
createWebLaunchConfiguration(projectData),
238238
createAttachConfiguration()
239239
]
240-
}
240+
};
241241
}
242242
}
243243

@@ -354,7 +354,7 @@ function hasWebServerDependency(targetProjectData: TargetProjectData): boolean {
354354
return false;
355355
}
356356

357-
for (var key in projectJsonObject.dependencies) {
357+
for (let key in projectJsonObject.dependencies) {
358358
if (key.toLowerCase().startsWith("microsoft.aspnetcore.server")) {
359359
return true;
360360
}

src/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function getBinPath() {
2828
export function buildPromiseChain<T, TResult>(array: T[], builder: (item: T) => Promise<TResult>): Promise<TResult> {
2929
return array.reduce(
3030
(promise, n) => promise.then(() => builder(n)),
31-
Promise.resolve<TResult>(null))
31+
Promise.resolve<TResult>(null));
3232
}
3333

3434
export function execChildProcess(command: string, workingDirectory: string = getExtensionPath()): Promise<string> {

src/coreclr-debug/activate.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
'use strict';
66

77
import * as vscode from 'vscode';
8-
import * as fs from 'fs';
98
import TelemetryReporter from 'vscode-extension-telemetry';
10-
import { CoreClrDebugUtil, DotnetInfo, DotNetCliError } from './util';
9+
import { CoreClrDebugUtil, DotnetInfo, } from './util';
1110
import * as debugInstall from './install';
12-
import * as path from 'path';
13-
import { Logger } from './../logger'
11+
import { Logger } from './../logger';
1412

1513
let _debugUtil: CoreClrDebugUtil = null;
1614
let _reporter: TelemetryReporter = null;
@@ -34,7 +32,7 @@ export function activate(context: vscode.ExtensionContext, reporter: TelemetryRe
3432
vscode.window.setStatusBarMessage('Successfully installed .NET Core Debugger.');
3533
})
3634
.catch((err) => {
37-
logger.appendLine("[ERROR]: An error occured while installing the .NET Core Debugger:")
35+
logger.appendLine("[ERROR]: An error occured while installing the .NET Core Debugger:");
3836
logger.appendLine(err);
3937
showInstallErrorMessage();
4038
// TODO: log telemetry?
@@ -71,10 +69,4 @@ function showDotnetToolsWarning(message: string) : void
7169
}
7270
});
7371
}
74-
}
75-
76-
function logTelemetry(eventName: string, properties?: {[prop: string]: string}): void {
77-
if (_reporter !== null) {
78-
_reporter.sendTelemetryEvent('coreclr-debug/' + eventName, properties);
79-
}
8072
}

src/coreclr-debug/install.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class DebugInstaller {
5353
return Promise.resolve().then(() => {
5454
errorBuilder.installStage = 'rewriteManifest';
5555
this.rewriteManifest();
56-
errorBuilder.installStage = 'writeCompletionFile'
56+
errorBuilder.installStage = 'writeCompletionFile';
5757
return CoreClrDebugUtil.writeEmptyFile(this._util.installCompleteFilePath());
5858
}).catch((err) => {
5959
if (errorBuilder.errorMessage === null) {

src/coreclr-debug/proxy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function proxy() {
5656
let extensionPath = path.resolve(__dirname, '../../../');
5757
common.setExtensionPath(extensionPath);
5858

59-
let logger = new Logger((text) => { console.log(text) });
59+
let logger = new Logger((text) => { console.log(text); });
6060
let util = new CoreClrDebugUtil(extensionPath, logger);
6161

6262
if (!CoreClrDebugUtil.existsSync(util.installCompleteFilePath())) {

src/coreclr-debug/util.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
*--------------------------------------------------------------------------------------------*/
55
'use strict';
66

7-
import * as child_process from 'child_process';
87
import * as path from 'path';
98
import * as fs from 'fs';
10-
import * as os from 'os';
119
import * as semver from 'semver';
12-
import { execChildProcess } from './../common'
13-
import { Logger } from './../logger'
10+
import { execChildProcess } from './../common';
11+
import { Logger } from './../logger';
1412

1513
const MINIMUM_SUPPORTED_DOTNET_CLI: string = '1.0.0-preview2-003121';
1614

src/features/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import * as fs from 'fs-extra-promise';
1313
import * as path from 'path';
1414
import * as protocol from '../omnisharp/protocol';
1515
import * as vscode from 'vscode';
16-
import * as dotnetTest from './dotnetTest'
16+
import * as dotnetTest from './dotnetTest';
1717
import {DotNetAttachItemsProviderFactory, AttachPicker} from './processPicker';
1818
import {generateAssets} from '../assets';
1919

@@ -183,7 +183,7 @@ function dotnetRestore(cwd: string, fileName?: string) {
183183

184184
dotnet.on('error', err => {
185185
channel.appendLine(`ERROR: ${err}`);
186-
reject(err)
186+
reject(err);
187187
});
188188
});
189189
}

src/features/dotnetTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function debugDotnetTest(testMethod: string, fileName: string, server: Om
6868
}
6969
).then(
7070
response => { },
71-
reason => { vscode.window.showErrorMessage(`Failed to start debugger on test because ${reason}.`) });
71+
reason => { vscode.window.showErrorMessage(`Failed to start debugger on test because ${reason}.`); });
7272
});
7373
}
7474

src/features/processPicker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ abstract class DotNetAttachItemsProvider implements AttachItemsProvider {
7575
} else if (b.name.toLowerCase() === dotnetProcessName) {
7676
return 1;
7777
} else {
78-
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1
78+
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
7979
}
8080
});
8181

0 commit comments

Comments
 (0)