TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

List @deprecated strikethroughs in Problems tab

Open morganwdavis opened this issue 5 years ago • 8 comments

The new deprecated strikethroughs in TS code are great. But to make it easier to find and address a series of them, it would be nice to have them also appear in the Problems tab (as an optional view, controlled by a settings flag).

morganwdavis avatar Sep 16 '20 22:09 morganwdavis

Moving upstream for more feedback

I believe we can already generate these diagnostics on the VS Code side if we want, but perhaps TS should have a compiler flag the enables treating usage of deprecated symbols as an error/warning

mjbvz avatar Sep 17 '20 01:09 mjbvz

~~Do we already have wraning? If not I'm happy to support that both ts & code side~~ I got it.

Kingwl avatar Sep 17 '20 06:09 Kingwl

After thinking about this again, I'm pretty sure that the solution I'd like to see is

  1. VS Code showing suggestions in the problems tab, as suggestions.
  2. A compiler CLI flag to emit all suggestions as errors. (Or similar to errors, with different formatting.)

sandersn avatar Mar 11 '21 00:03 sandersn

For those looking for a solution, I found this comment in one of the referenced MR.

https://github.com/microsoft/TypeScript/pull/40607#issuecomment-1369051173

--

However I wish that the deprecated warnings/infos are displayed in the problems tab out of the box

ericgoe avatar Jul 09 '24 07:07 ericgoe

For those looking for a solution, I found this comment in one of the referenced MR.

#40607 (comment)

--

However I wish that the deprecated warnings/infos are displayed in the problems tab out of the box

It's only partial, it just catches the use of a deprecated field (deconstruction) const a = x.deprecated; but does not catch things such as assignations const a: X = { deprecated: 123 }; or destructuring assignment const f: X = ({ deprecated }) => 123; or const { deprecated } = a;, or some more complex cases such as const param = { deprecated: 123 }; callModule(param);. Listing deprecations is quite complex and must target a lot of specific cases. But it's so important that I think it should be handled by TS as warnings during type check and in editor's problems.

jer-sen avatar Jul 09 '24 12:07 jer-sen

+1

devi-prsd avatar Sep 25 '24 08:09 devi-prsd

👍

kozi avatar Feb 24 '25 07:02 kozi

I found this when looking for the setting I assumed to already exist to enable deprecation warnings. It's surprising to me that this isn't base functionality, and I hope we get it included.

sehrgut avatar Mar 07 '25 19:03 sehrgut

I agree - Would love to see this as it would make development much easier

AstroGD avatar Apr 04 '25 07:04 AstroGD