-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
A new typescript compiler option to indicate deprecation warnings #49433
Comments
See comments in #390 (comment) A stable definition of "using" a deprecated method is just incredibly difficult and not something we think we can deliver in a predictable-enough manner to justify making an in-box behavior. There are too many ways you can indirect a function and it's just not clear where the right place to draw the lines is, and it seems extremely likely that different people will have strong disagreements about where it's acceptable to indirect a deprecated property into a non-deprecated position and where you can't. |
Many projects use |
While it’s true that this could never catch everything anyone ever intended to deprecate, ‘@deprecated’ is so widely used that this would be very useful even if it only looks for that. |
I see deprecations in the IDE but have so far been unable to find all of them across the entire code base. Old TsLint Rule: typescript-eslint/typescript-eslint#1223 |
It will be great to have such option, to show warnings or errors on of deprecated code usage. It will help to avoid unexpected bugs. For example: class Bla {
constructor(name) {
this.name = name;
}
check() {
console.log(name);
}
}
new Bla("ololo").check() // something interesting
I thinks is is very important to catch such things. |
This issue has been marked as "Declined" and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
This is still an ongoing issue. It's pretty awkward that you can't mark something as deprecated, and downstream users will get a compiler error with the deprecated message. Instead they are surprised when it's removed, with no message to help them. Someone needs to make an anti-autoclose-bot-bot. |
Hi, When I wrote following code, typescript complier didn't warn me about the deprecation warning except a strikethrough of the deprecated attribute. I would like if we can setup complier with a new option for deprecation warnings.
Playground link
https://www.typescriptlang.org/play?#code/MYewdgzgLgBAZmGBeGAKApgLhgWRAVwnQFEA3dMKASm1JAEsATZAPgG8AoGGUSWdADboAthVgp0AOggAnYMSGjKAbg4BfIA
Feature request
A new typescript compiler option to detect deprecation warnings.
Actual Behaviour
Typescript tsc command doesn't warn/fail when deprecated functions/attributes used.
Expected Behaviour
Typescript complier (tsc command) to fail/warn about deprecations.
The text was updated successfully, but these errors were encountered: