auto import always uses relative (to the current file) module paths in presense of baseUri
See original GitHub issueback in a day it used to be different
- at first it was always an absolute path (that is without “./” or “…/” in it) relative to the
baseUri
- then starting at some point it began to always show a popup with 2 options: absolute or relavive
- now (since like a week ago or so) it just always uses a relative path with “./” and “…/” to the current file no matter what, without asking, which is very frustrating and annoying
how can i get the auto import to use absolute paths like it was back in the day?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Typescript: How to auto import with absolute paths if baseUrl ...
I want the IDE to auto import modules as absolute paths starting from this base URL. But Intellij IDEA always uses relative paths, ......
Read more >Auto import in Visual Studio Code only offering absolute path ...
In Visual Studio Code, menu File → Preferences → Settings → User Settings, "typescript.preferences.importModuleSpecifier": "relative".
Read more >Documentation - Module Resolution - TypeScript
A non-relative import can be resolved relative to baseUrl , or through path mapping, which we'll cover below. They can also resolve to...
Read more >ECMAScript modules | Node.js v19.3.0 Documentation
Outside of those cases, Node.js will use the CommonJS module loader. ... They refer to a path relative to the location of the...
Read more >Configuring Jest
You can use --config flag to pass an explicit path to the file. ... that all imported modules in your tests should be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This should be exposed in VSCode (insiders as of now) under “typescript.preferences.importModuleSpecifier”: “non-relative”
Before that, I just noticed you’re using
.jsx
files – you might need to set “javascript.preferences.importModuleSpecifier” instead.