You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update documentation to mention that --strictNullChecks flag is necessary for --strictPropertyInitialization to have an effect #23659
Expected behavior:
TS documentation should mention that --strictNullChecks flag is needed for --strictPropertyInitialization one to actually have an effect.
This would properly document the actual code change in this commit :
This was clearly mentionned in the corresponding PR description.
Also mihailiksuggested that a warning could also be emitted. Has this been done?
Actual behavior:
This is mentioned nowhere in the documentation.
Documentation for --strictPropertyInitialization is Ensure non-undefined class properties are initialized in the constructor..
To determine if a class property is non-undefined, --strictNullChecks flag must be turned on.
changed the title [-]Update documentation to mention that `--strictNullChecks` is necessary for `--strictPropertyInitialization` to have an effect [/-][+]Update documentation to mention that --strictNullChecks flag is necessary for --strictPropertyInitialization to have an effect [/+]on Apr 24, 2018
A PR to warn for use of --strictPropertyInitialization with no --strictNullChecks would be welcomed. The fix should be added in 'verifyCompilerOptions'.
Activity
[-]Update documentation to mention that `--strictNullChecks` is necessary for `--strictPropertyInitialization` to have an effect [/-][+]Update documentation to mention that --strictNullChecks flag is necessary for --strictPropertyInitialization to have an effect [/+]mhegazy commentedon Apr 24, 2018
A PR to warn for use of
--strictPropertyInitializationwith no--strictNullCheckswould be welcomed. The fix should be added in 'verifyCompilerOptions'.mhegazy commentedon Apr 24, 2018
Also a PR to update the docs would be welcomed, the handbook is at https://github.com/Microsoft/TypeScript-Handbook
a-tarasyuk commentedon Apr 24, 2018
Mohamed Hegazy (@mhegazy) I'll make PR for that case.
Mention strictPropertyInitialization requires strictNullChecks
Mention strictPropertyInitialization requires strictNullChecks