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
Fix deprecations, improve messaging #52993
Conversation
This likely needs to be backported to 5.0, otherwise it will break if we introduce any other deprecations. |
(but, I have a small refractor to apply before doing so) |
src/compiler/program.ts
Outdated
} | ||
else if (reportInvalidIgnoreDeprecations) { | ||
createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations); | ||
const parsed = Version.tryParse(ignoreDeprecations); |
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.
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.
@typescript-bot cherry-pick this to release-5.0 |
Heya @jakebailey, I've started to run the task to cherry-pick this into |
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. |
figures |
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
ignoreDeprecation
option is not greater than or equal to the version in which the option became deprecated, then we'll issue an error saying to setignoreDeprecation
to 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.