Autoimport always imports relative paths #49994
Labels
javascript
JavaScript support issues
*question
Issue represents a question, should be posted to StackOverflow (VS Code)
Steps to Reproduce:
Expected behaviour:
Visual Studio Code offers the import to be relative to the project (baseUrl)
Actual behaviour:
Visual Studio Code will preferentially import using relative paths with "./" and "../"
import { processBatch } from '../batch';
This is a huge problem for us because our coding convention bans relative imports. Part of the reason is there's quite a few files with the same name so an import from "bank" could refer to 4 different files. Relative imports make it impossible to tell which one you're importing at a glance. You need to consider where you are in the tree already, know where that file sits relative to the one you're importing and then doing the mental gymnastics to figure out how the paths resolve. Relative paths might as well be called obfuscated paths.
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: