kingbri
kingbri2mo ago

Cannot use import maps

Hi there, I'm trying to make a project root alias @ so I don't have to suffer through relative path import hell (../../../../file.ts) However, when I specify "@/": "./" in the imports section of deno.json, I get an error from VSCode stating this:
The import specifier can be remapped to "@/absolutePath/file.ts" which will resolve it via the active import map.
The import specifier can be remapped to "@/absolutePath/file.ts" which will resolve it via the active import map.
Therefore, I either have to use absolute imports for every file or use only relative imports. I want to be able to use both. Is converting the project root to @/ not possible without some sort of src directory? Thanks in advance.
1 Reply
kingbri
kingbriOP2mo ago
GitHub
LSP: Import specifier remapping should prefer exact matches · Issue...
I'm currently using the postgres library, which I've mapped using the following in my imports of import-map.json. I use both the exact name, as well as the prefix, so that I can refer to su...

Did you find this page helpful?