question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript aliases auto-import instead of absolutes paths

See original GitHub issue
  • I have searched through existing issues
  • I have read FAQ
  • I have read through docs

Info

  • Platform: macOS Mojave 10.14.4
  • Vetur version: 0.20.0
  • VS Code version: 1.33.1

Problem

Auto-import in .vue files where typescript is enabled isn’t taking account of aliases defined in tsconfig.json. It will write absolute paths whereas in .ts files it works fine

In .vue file

vetur

tsconfig.json

image

in .ts file

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:20
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
octrefcommented, Aug 3, 2020

Duplicate of #1177, which is fixed by #1753.

0reactions
jackkoppacommented, Oct 29, 2019

Possibly discussed in #1177?

There, it’s labeled as a feature request; not sure exactly what work would be required on this

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript prefers importing relative import instead of path alias
What seems to help is to set paths to use ./ instead of @/ and use "typescript.preferences.importModuleSpecifier": "non-relative" setting in ...
Read more >
Advanced Features: Absolute Imports and Module Path Aliases
Configure module path aliases that allow you to remap certain import paths. ... Note: jsconfig.json can be used when you don't use TypeScript....
Read more >
Using absolute (alias) imports in Javascript and VSCode
Learn how to import javascript or typescript modules with absolute paths in webpack & VSCode. Developers love productivity hacks.
Read more >
allow relative imports for files under path mappings - YouTrack
WEB-32466 Webstorm uses TS paths instead of plain old regular paths ... project) then IntelliJ autoimport always with absolute path. e.g. tsconfig.json.
Read more >
Clean Up Your Imports using Absolute ... - DEV Community ‍ ‍
For Create React App without using Craco ... The absolute import will only remove the relative path, but won't add @/ alias. For...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found