ts-unused-exports: False positives on the unused export list

I got so many unused exports report that are actually used.

Mostly are default exports on Components and Containers, seems they are all detected as unused.

Some of them are detected as unused if it is imported using alias like import {a as b} from "abc".

Some are just plainly wrong detection, when I checked the function is used in several places across the codebase.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 9
  • Comments: 21

Commits related to this issue

Most upvoted comments

Yeah, I have exactly the same issue when:

  1. I have export default SomeFunction in index.tsx
  2. In the folder above in OtherFunction.tsx I write import SomeFunction from ./folderSomeFunction

The export default in index.tsx is indicated as unused.


ver: “ts-unused-exports”: “^7.0.3”

I think the absolute import comes from the compilerOptions https://justinnoel.dev/2019/06/18/configuring-react-absolute-imports-for-typescript/