Fix deprecations, improve messaging#52993
Merged
jakebailey merged 11 commits intomicrosoft:mainfrom Mar 7, 2023
Merged
Conversation
jakebailey
commented
Feb 27, 2023
Member
Author
|
This likely needs to be backported to 5.0, otherwise it will break if we introduce any other deprecations. |
Member
Author
|
(but, I have a small refractor to apply before doing so) |
sheetalkamat
approved these changes
Feb 28, 2023
jakebailey
commented
Mar 1, 2023
src/compiler/program.ts
Outdated
| } | ||
| else if (reportInvalidIgnoreDeprecations) { | ||
| createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations); | ||
| const parsed = Version.tryParse(ignoreDeprecations); |
Member
Author
There was a problem hiding this comment.
We talked about this and it seems like the intent is that we are not going to deprecate anything between TS 5.0 and TS 6.0, so this is overkill, and we can just write === "5.0" and error.
sheetalkamat
approved these changes
Mar 1, 2023
DanielRosenwasser
approved these changes
Mar 7, 2023
RyanCavanaugh
approved these changes
Mar 7, 2023
Member
Author
|
@typescript-bot cherry-pick this to release-5.0 |
Collaborator
|
Heya @jakebailey, I've started to run the task to cherry-pick this into |
Collaborator
|
Hey @jakebailey, I couldn't open a PR with the cherry-pick. (You can check the log here). You may need to squash and pick this PR into release-5.0 manually. |
Member
Author
|
figures |
jakebailey
added a commit
to jakebailey/TypeScript
that referenced
this pull request
Mar 7, 2023
DanielRosenwasser
pushed a commit
that referenced
this pull request
Mar 10, 2023
drivron
pushed a commit
to scenari/typescript
that referenced
this pull request
Sep 14, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As noted in #52975, things don't appear to be working as expected.
This PR makes it so that for every set of deprecated values, there is:
If the current version is greater than or equal to the version in which the option was removed, then you get an error saying that the option has been removed and must be removed from
tsconfig.json.Otherwise, if the
ignoreDeprecationoption is not greater than or equal to the version in which the option became deprecated, then we'll issue an error saying to setignoreDeprecationto at least the version that allows there to be no errors.Along the way:
Option 'target=ES3'.What changes in this PR in baselines is all messages, however, one test includes what happens if the version is 6.0; I think the new behavior is fine. There's nothing special about 6.0 compared to 5.5.