Closed davidparkagoda closed 4 years ago
Yes that is correct. When your tsconfig does not have absolute paths (baseUrl) nor paths (aliases) we do not have this problem.
I also wanted to fix the with-paths
problem however it looks like I have to send a pr request to tsconfig-paths
because it does it strip .d.ts
correctly.
hi @davidparkagoda
I'm still not sure I understand. Please bear with me - here is a summary of my understanding - perhaps you can read it and see if this is correct:
There is a bug where there are false positives, if importing from a d.ts
file
There is another problem, involving with-paths
.
Can you describe this problem?
Thanks David, Sean
Yea no problem.
the second bug is with-paths. You can add the extension .d.ts
in this array,
https://github.com/pzavolinsky/ts-unused-exports/blob/783815f950034540529a23788f0ad9da0df14537/src/parser/import.ts#L13
however tsconfig-paths does not strip .d
from the file.
I created another pull request to fix it in tsconfig-paths
to correctly strip extensions correctly regardless of how many .
there are.
https://github.com/dividab/tsconfig-paths/pull/124
hi @davidparkagoda
thank you for the explanation.
This fix looks good.
To proceed, I would suggest:
CHANGELOG.md
like this:
### Changed
- .... (summary of the fix) ...
For the 2nd issue - I would suggest opening a separate issue/PR for that.
Oh, and this branch needs to be rebased on master :)
Hi @davidparkagoda your fix is useful - so to get it released, I opened a new PR (#150), that has a CHANGELOG entry.
So I think PR can be closed.
For the bug with with-paths
it could be good to have a separate PR, with suitable test.
Alternatively, If you have an example that I could use to reproduce that problem, that would be great.
Thank you for your contribution!
hi @davidparkagoda thanks for the pull request.
Can you give a description of what this PR is about?
It looks like a test to see that we don't get false positives, or errors, if importing from a
d.ts
file ?