Enables typescript strict mode

Fixes all the compile/lint issues
This commit is contained in:
Eric Amodio
2017-05-11 02:14:58 -04:00
parent 90245b1111
commit ee29596d45
52 changed files with 525 additions and 461 deletions

View File

@@ -19,9 +19,11 @@ const UrlRegex = /^(?:git:\/\/(.*?)\/|https:\/\/(.*?)\/|http:\/\/(.*?)\/|git@(.*
export class RemoteProviderFactory {
static getRemoteProvider(url: string): RemoteProvider {
static getRemoteProvider(url: string): RemoteProvider | undefined {
try {
const match = UrlRegex.exec(url);
if (match == null) return undefined;
const domain = match[1] || match[2] || match[3] || match[4] || match[5];
const path = match[6].replace(/\.git/, '');

View File

@@ -26,10 +26,12 @@ export abstract class RemoteProvider {
protected abstract getUrlForBranch(branch: string): string;
protected abstract getUrlForCommit(sha: string): string;
protected abstract getUrlForFile(fileName: string, branch: string, sha?: string, range?: Range): string;
protected abstract getUrlForFile(fileName: string, branch?: string, sha?: string, range?: Range): string;
private async _openUrl(url: string): Promise<{}> {
return url && commands.executeCommand(BuiltInCommands.Open, Uri.parse(url));
private async _openUrl(url: string): Promise<{} | undefined> {
if (url === undefined) return undefined;
return commands.executeCommand(BuiltInCommands.Open, Uri.parse(url));
}
open(type: 'branch', branch: string): Promise<{}>;