diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 753f6e7411e..9b103334142 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -121,6 +121,7 @@ "./vs/code/electron-main/keyboard.ts", "./vs/code/electron-main/sharedProcess.ts", "./vs/code/electron-main/theme.ts", + "./vs/code/node/cli.ts", "./vs/code/node/paths.ts", "./vs/code/node/shellEnv.ts", "./vs/code/node/wait.ts", @@ -702,7 +703,8 @@ "./vs/workbench/services/themes/common/workbenchThemeService.ts", "./vs/workbench/services/title/common/titleService.ts", "./vs/workbench/services/workspace/common/workspaceEditing.ts", - "./vs/workbench/test/electron-browser/api/mock.ts" + "./vs/workbench/test/electron-browser/api/mock.ts", + "./vs/platform/backup/electron-main/backupMainService.ts" ], "exclude": [ "./typings/require-monaco.d.ts" diff --git a/src/vs/code/node/cli.ts b/src/vs/code/node/cli.ts index e7b4226e604..0af39ce7e42 100644 --- a/src/vs/code/node/cli.ts +++ b/src/vs/code/node/cli.ts @@ -77,7 +77,7 @@ export async function main(argv: string[]): Promise { try { // Check for readonly status and chmod if so if we are told so - let targetMode: number; + let targetMode: number = 0; let restoreMode = false; if (!!args['file-chmod']) { targetMode = fs.statSync(target).mode; @@ -132,11 +132,11 @@ export async function main(argv: string[]): Promise { child.stdout.on('data', (data: Buffer) => console.log(data.toString('utf8').trim())); child.stderr.on('data', (data: Buffer) => console.log(data.toString('utf8').trim())); - return new TPromise(c => child.once('exit', () => c())); + return new TPromise(c => child.once('exit', () => c(void 0))); }); } - let stdinWithoutTty: boolean; + let stdinWithoutTty: boolean = false; try { stdinWithoutTty = !process.stdin.isTTY; // Via https://twitter.com/MylesBorins/status/782009479382626304 } catch (error) { @@ -162,7 +162,7 @@ export async function main(argv: string[]): Promise { stdinFilePath = paths.join(os.tmpdir(), `code-stdin-${Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 3)}.txt`); // open tmp file for writing - let stdinFileError: Error; + let stdinFileError: Error | undefined; let stdinFileStream: fs.WriteStream; try { stdinFileStream = fs.createWriteStream(stdinFilePath); @@ -227,7 +227,7 @@ export async function main(argv: string[]): Promise { // and pass it over to the starting instance. We can use this file // to wait for it to be deleted to monitor that the edited file // is closed and then exit the waiting process. - let waitMarkerFilePath: string; + let waitMarkerFilePath: string | undefined; if (args.wait) { waitMarkerFilePath = await createWaitMarkerFile(verbose); if (waitMarkerFilePath) { @@ -361,10 +361,10 @@ export async function main(argv: string[]): Promise { return new TPromise(c => { // Complete when process exits - child.once('exit', () => c(null)); + child.once('exit', () => c(void 0)); // Complete when wait marker file is deleted - whenDeleted(waitMarkerFilePath).then(c, c); + whenDeleted(waitMarkerFilePath!).then(c, c); }).then(() => { // Make sure to delete the tmp stdin file if we have any diff --git a/src/vs/platform/backup/electron-main/backupMainService.ts b/src/vs/platform/backup/electron-main/backupMainService.ts index 362719331e4..e34e8728d3e 100644 --- a/src/vs/platform/backup/electron-main/backupMainService.ts +++ b/src/vs/platform/backup/electron-main/backupMainService.ts @@ -182,7 +182,7 @@ export class BackupMainService implements IBackupMainService { this.rootWorkspaces = this.validateWorkspaces(backups.rootWorkspaces); // read folder backups - let workspaceFolders: URI[]; + let workspaceFolders: URI[] = []; try { if (Array.isArray(backups.folderURIWorkspaces)) { workspaceFolders = backups.folderURIWorkspaces.map(f => URI.parse(f)); diff --git a/src/vs/platform/configuration/node/configuration.ts b/src/vs/platform/configuration/node/configuration.ts index 63c84fd20b3..ff31af9c645 100644 --- a/src/vs/platform/configuration/node/configuration.ts +++ b/src/vs/platform/configuration/node/configuration.ts @@ -37,7 +37,7 @@ export class UserConfiguration extends Disposable { } reload(): Promise { - return new Promise(c => this.userConfigModelWatcher.reload(() => c(null))); + return new Promise(c => this.userConfigModelWatcher.reload(() => c())); } } \ No newline at end of file