-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Update descriptions for strict-related flags #63095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request updates the default value descriptions for strict-related compiler flags to more accurately reflect their behavior. The change improves clarity by stating that these flags default to true (unless strict is disabled) rather than the previous wording which suggested they default to false (unless strict is set).
Changes:
- Updated the diagnostic message text from "
false, unlessstrictis set" to "true, unlessstrictis disabled" - Applied this updated description to all 8 strict-related flags: noImplicitAny, strictNullChecks, strictFunctionTypes, strictBindCallApply, strictPropertyInitialization, strictBuiltinIteratorReturn, noImplicitThis, and useUnknownInCatchVariables
- Updated the test baseline to reflect the new help output
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/compiler/diagnosticMessages.json | Updates the diagnostic message definition used for strict flag defaults |
| src/compiler/commandLineParser.ts | Updates all 8 strict flag options to reference the new diagnostic message |
| tests/baselines/reference/tsc/commandLine/help-all.js | Updates the baseline to reflect the new default value descriptions in help output |
| }, | ||
|
|
||
| "`false`, unless `strict` is set": { | ||
| "`true`, unless `strict` is disabled": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "`true`, unless `strict` is disabled": { | |
| "`true`, unless `strict` is `false`": { |
maybe?
Kind of weird to phrase these in this way, but for most users these are functionally
truegoing forward.Maybe it would feel less confusing if we said "true as long as strict is still enabled".