Skip to content

Enable --strictPropertyInitialization#27558

Merged
4 commits merged into
masterfrom
strictPropertyInitialization
Nov 17, 2018
Merged

Enable --strictPropertyInitialization#27558
4 commits merged into
masterfrom
strictPropertyInitialization

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Oct 4, 2018

Enables --strictPropertyInitialization in tsconfig-base.json and updates declarations that were now errors.

Comment thread src/server/project.ts Outdated
/* @internal */
getCurrentProgram() {
return this.program;
return Debug.assertDefined(this.program);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is always defined? This can be undefined

Comment thread src/server/editorServices.ts Outdated
private pendingProjectUpdates = createMap<Project>();
/* @internal */
pendingEnsureProjectForOpenFiles: boolean;
pendingEnsureProjectForOpenFiles: boolean | undefined;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

= false instead ?

Comment thread src/server/project.ts Outdated

/*@internal*/
canConfigFileJsonReportNoInputFiles: boolean;
canConfigFileJsonReportNoInputFiles: boolean | undefined;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

= false?

Comment thread src/server/scriptInfo.ts Outdated

/*@internal*/
cacheSourceFile: DocumentRegistrySourceFileCache;
cacheSourceFile!: DocumentRegistrySourceFileCache; // TODO: GH#18217
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be instead DocumentRegistrySourceFileCache | undefined

Comment thread src/services/shims.ts
if ("directoryExists" in this.shimHost) {
this.directoryExists = directoryName => this.shimHost.directoryExists(directoryName);
}
else {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Copy Markdown
Author

@ghost ghost Oct 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypingResolutionHost requires directoryExists to be non-optional. It's likely that this.shimHost always contains directoryExists, so it always gets defined. Currently putting in these else blocks as a place to hold the TODO.

@ghost
Copy link
Copy Markdown
Author

ghost commented Oct 8, 2018

@sheetalkamat Please re-review

@ghost ghost merged commit 12f3d0d into master Nov 17, 2018
@ghost ghost deleted the strictPropertyInitialization branch November 17, 2018 00:02
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant