ts-unused-exports: False positive with path aliases and sub-folders
Steps to reproduce with example\with-paths
:
- Move
utils\src\calculations.ts
into a new sub-folderutils\src\sub\calculations.ts
. - Update import statement in
math.ts
toimport {calculations} from 'utils/sub/calculations';
- Run
ts-unused-exports example\with-paths\tsconfig.json
utils\src\sub\calculations.ts: calculations
is falsely reported as unused.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 15
Commits related to this issue
- Add test to repro issue with path alias and sub folders #154 — committed to pzavolinsky/ts-unused-exports by mrseanryan 4 years ago
- Add test to repro issue with path alias and sub folders #154 — committed to pzavolinsky/ts-unused-exports by mrseanryan 4 years ago
- Add test to repro issue with path alias and sub folders #154 — committed to pzavolinsky/ts-unused-exports by mrseanryan 4 years ago
UPDATE:
Ineed, the problem is the file being imported is index Another very similar file other works OK.
but at this point its simpler for me to manage, as a separate related issue.
@mrseanryan sorry for the delay, there are no more false positives.
@ilyin371 @kevinoliveira have a fix here:
https://github.com/pzavolinsky/ts-unused-exports/pull/176
If you have the time, it would great to get feedback before we merge and release.
Branch is:
fix/path-aliases-and-sub-folders
cheers @kevinoliveira
I think it is related to the
#customAlias
part:This helps a lot!
same issue here, I can confirm it’s due to path aliases. i can create a reproducible environment later today.
PS: awesome project