-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check for .d.ts files for path aliases #151
check for .d.ts files for path aliases #151
Conversation
question -
We could add a TODO to remove our 'patch' once |
Yes we could definitely do that but it does not feel great. Even if we do this 'patch', the workarounds that I see are not great. We could do something like If you are okay with one of those solutions or have a better workaround I am willing to make the change |
| We could do something like I think this would work? Or - in which cases would this cause a problem ? |
I know this is kind of edge case but a files named like
you would need import from javascript like but ts-unsused-exports would be looking for |
Hmm wouldn't that also happen with the fix for tsconfig-paths? |
No. When You will not be able to have the same kind of "bug" with the fix for
However if you imported |
I see. So in such cases, tsconfig-paths checks for file exists. Question is that covered by this approach:
|
yes this would work. something like
|
is this PR completed ? (it looks good to me). Thanks, |
@mrseanryan yup everything should be good. Please go ahead and do anything to get this merged in :D |
@davidparkagoda Thank you for your contribution ! |
Summary:
Tries to fix a bug where there are false positives, if importing from a d.ts file.
This only occurs if tsconfig uses aliases (paths).
This PR would need another PR to be merged in
dividab/tsconfig-paths#124
Right now tsconfig-paths is returning file paths with the extension stripped,
src/something/hi.ts
=>src/something/hi
.However this extension stripping only removes 1 level of
.
so when we matched.d.ts
files it will incorrectly strip the extension to be likesrc/something/hi.d.ts
=>src/something/hi.d
.