TypeScript: Poor deprecated messages - types should almost never be displayed.
/** @deprecated - this is bad advice */
declare function crossTheStreams(): void
crossTheStreams()
Expected: 'crossTheStreams' is deprecated.
Actual: '(): void' is deprecated
Notice the type in place of the entity name, notice the lack of a period at the end.

About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 17 (17 by maintainers)
Commits related to this issue
- fixes microsoft/TypeScript#41286 — committed to AnyhowStep/TypeScript by AnyhowStep 4 years ago
- fixes microsoft/TypeScript#41286 (#41294) * fixes microsoft/TypeScript#41286 * Added period to end of deprecation message * Search Symbol.declarations for deprecated tag instead of Symbol.value... — committed to microsoft/TypeScript by AnyhowStep 3 years ago
I see I had the wrong idea of what
valueDeclarationwas. It’s conditionally set.Only if not every overload is deprecated. If all overloads are deprecated, showing the type doesn’t help.
It is better to use one of the various helpers for printing out the expression when a name is available. We’ve done this in a couple of places where we try to special case this when the invoked expression is an identifier/property access.
First value declarationmeansfirst declaration of valueYou can also find all declarations(includes valueDeclaration) in the
declarationsfieldNote: This should normally happen only with overloads. It’s not great with overloads either, so probably the overload message should be
'{0}' with type '{1}' is deprecated.instead of putting a type into'{0}' is deprecated