@deprecated functions are not crossed out if imported via a third package that re-exports the affected function

Hello everybody!

I noticed an issue with IntelliJ IDEA Ultimate's and WebStorm's (and probably others') Inspections. I have the following scenario:

  • A monorepo (with npm workspaces) and multiple packages, all written in TypeScript.
  • One package (let's call it 'lib') contains a function marked as @deprecated in JSDoc.
  • Another package (let's call it 'wrapper') re-exports this function (via `export { deprecatedFunction } from '@my-lib/lib';`)
  • And another package (let's call it 'main') consumes this function, but it does not import it from 'lib' but from 'wrapper'.
  • This scenario also works if the deprecated function is not implemented in 'lib' but by a third-party library imported via npm.

Now, when I open the file where the function is being used in 'main', it is not crossed out in the editor. However, importing it directly from 'lib' works fine.

Here is a screenshot of how it looks like:

I have created a minimal repository to reproduce this issue: https://github.com/abraxas-von-abrasax/depr-test

Currently, it is really a pain as I'm working with a more extensive monorepo setup where multiple packages provide an interface for consuming their own but also other third-party classes and functions and it's not immediately obvious if a function is marked as deprecated (for instance by the package maintainer).

I really appreciate your help and thank you in advance!

Nenad Petkovic

评论操作 固定链接

sorry, but @depr-test/lib package is missing in your repo

0
评论操作 固定链接

Ups, I'm sorry. I included it now.

0

请先登录再写评论。