-
Notifications
You must be signed in to change notification settings - Fork 28
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
Support imports map in package.json #124
Comments
Hello @jgoux, thanks for opening that issue! You are right, "imports" map feature is not supported by skott's module resolution algorithm yet. In my opinion this is something that should definitely be added in skott and I was kind of waiting for it to be requested before implementing it as often people would use TypeScript path aliases in the first place (which is already mostly supported) 😄
Glad to hear that, it's great to see the beginning of a unified way of having path aliases for JS/TS, that are both supported by LSP and the runtime with no configuration overhead or path rewrites required! In addition to "imports", there is also "exports" map that counter-intuitively allows to reference path aliases through self-referencing. But this could be implemented later as I think "imports" map is or will become the most common use case for these.
I was completely unaware of that tool, it looks great and already widely adopted, thanks for sharing! Could you please elaborate on what is currently implemented in Consequently I think that skott should and will delegate some of its features to other tools at some point (started a little bit with Note also that this kind of feature was initially requested a while ago by @ild0tt0re in #13, and I initially thought of using something like My biggest concern is about the integration, because both But this is something we can definitely think about and try out as you are contributing to |
Summary
The imports map doesn't seem supported, if I do something like
import { t } from "#config/trpc.js";
it doesn't appear in the graph.Details
Now that we have
nodenext
in TypeScript, using the imports map is the standard way of aliasing paths internally in a package, so I'd love to have it supported in skott.Standard questions
Please answer these questions to help us investigate your issue more quickly:
As a side-note, it seems that they are a lot of overlaps between skott and knip. I'm working on a "future-proof" TypeScript monorepo example, and I think skott would be a great addition to it. I'm also already using knip which is already on point to crawl every files and understand dependencies (including imports map), so maybe there could be some kind of collaboration here? 😄
The text was updated successfully, but these errors were encountered: