pzavolinsky / ts-unused-exports

ts-unused-exports finds unused exported symbols in your Typescript project
MIT License
749 stars 49 forks source link

Add support for import with @ prefix #266

Closed mrseanryan closed 1 year ago

mrseanryan commented 1 year ago

Import statements like this are not handled, so usages are not picked up:

import { foo } from "@foo/index";

note: usages like the following ARE supported:

import { foo } from "./foo/index";
import { foo } from "@foo/other";

So the problem is if file is index, imported via custom path.


In the repro below, there's a single export foo being reported as unused, despite it clearly being used, https://github.com/aryzing/practice-ts-unused-exports

Originally posted by @aryzing in https://github.com/pzavolinsky/ts-unused-exports/issues/154#issuecomment-1404935595

mrseanryan commented 1 year ago

We fixed a bug where importing from index files did not work in some cases, especially with custom paths like 'foo' or 'foo/index'.