denoland / deno_lint

Blazing fast linter for JavaScript and TypeScript written in Rust
https://lint.deno.land/
MIT License
1.52k stars 170 forks source link

JSDoc `@deprecated` diagnostics #623

Open kitsonk opened 3 years ago

kitsonk commented 3 years ago

deno_lint should be able to parse the JSDoc for symbols and identify ones that have the @deprecated flag and issue a diagnostic if the @deprecated APIs are being used.

lucacasonato commented 3 years ago

This is not possible without type information.

kitsonk commented 3 years ago

How so? swc bundling tracks symbols across modules without type information, so the swc parser is aware of what symbols are used where and what JSDoc is associated with them.

lucacasonato commented 3 years ago

The linter operates on single files though, not on an entire graph. We don't have info about any symbols outside of the file being linted.

kitsonk commented 3 years ago

At the moment, and that is different than requiring type information.

petamoriken commented 3 years ago

FYI: https://github.com/denoland/deno/issues/7982#issuecomment-909906237

Annex B will be annotated as @deprecated in TypeScript 4.5 and later, it will may be possible to prevent it from being used. microsoft/TypeScript#43709

iuioiua commented 4 months ago

This would be an amazing addition to the linter. Is this now possible?