diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 59f6328c061..e87e4dc83eb 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -6,7 +6,10 @@ }, "include": [ "./typings", - "./vs/base/common/iterator.ts" + "./vs/base/common/charCode.ts", + "./vs/base/common/iterator.ts", + "./vs/base/common/platform.ts", + "./vs/base/common/uri.ts" ], "exclude": [ "./typings/require-monaco.d.ts" diff --git a/src/vs/base/common/platform.ts b/src/vs/base/common/platform.ts index 9e3496c8160..4b703fc900a 100644 --- a/src/vs/base/common/platform.ts +++ b/src/vs/base/common/platform.ts @@ -8,9 +8,9 @@ let _isMacintosh = false; let _isLinux = false; let _isNative = false; let _isWeb = false; -let _locale: string = undefined; -let _language: string = undefined; -let _translationsConfigFile: string = undefined; +let _locale: string | undefined = undefined; +let _language: string | undefined = undefined; +let _translationsConfigFile: string | undefined = undefined; interface NLSConfig { locale: string; @@ -129,7 +129,7 @@ export const translationsConfigFile = _translationsConfigFile; const _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {} as any); export const globals: any = _globals; -let _setImmediate: (callback: (...args: any[]) => void) => number = null; +let _setImmediate: ((callback: (...args: any[]) => void) => number) | null = null; export function setImmediate(callback: (...args: any[]) => void): number { if (_setImmediate === null) { if (globals.setImmediate) { @@ -140,7 +140,7 @@ export function setImmediate(callback: (...args: any[]) => void): number { _setImmediate = globals.setTimeout.bind(globals); } } - return _setImmediate(callback); + return _setImmediate!(callback); } export const enum OperatingSystem { diff --git a/src/vs/base/common/uri.ts b/src/vs/base/common/uri.ts index 3ce4b48c95b..c0d3423e240 100644 --- a/src/vs/base/common/uri.ts +++ b/src/vs/base/common/uri.ts @@ -141,7 +141,7 @@ export class URI implements UriComponents { /** * @internal */ - protected constructor(scheme: string, authority: string, path: string, query: string, fragment: string); + protected constructor(scheme: string, authority?: string, path?: string, query?: string, fragment?: string); /** * @internal @@ -386,8 +386,8 @@ interface UriState extends UriComponents { // tslint:disable-next-line:class-name class _URI extends URI { - _formatted: string = null; - _fsPath: string = null; + _formatted: string | null = null; + _fsPath: string | null = null; get fsPath(): string { if (!this._fsPath) { @@ -465,7 +465,7 @@ const encodeTable: { [ch: number]: string } = { }; function encodeURIComponentFast(uriComponent: string, allowSlash: boolean, firstPos: number = 0): string { - let res: string = undefined; + let res: string | undefined = undefined; let nativeEncodePos = -1; for (let pos = firstPos; pos < uriComponent.length; pos++) { @@ -526,7 +526,7 @@ function encodeURIComponentFast(uriComponent: string, allowSlash: boolean, first } function encodeURIComponentMinimal(path: string): string { - let res: string = undefined; + let res: string | undefined = undefined; for (let pos = 0; pos < path.length; pos++) { let code = path.charCodeAt(pos); if (code === CharCode.Hash || code === CharCode.QuestionMark) {