Use `vue-typescript` (from Volar) for supporting vue, instead of directly using sfc compiler
See original GitHub issueI was looking for a solution for #40, and I asked in the Volar Discord channel. and the main developer told me that:
johnsoncodehk — 06/13/2022 I see, they could consider using vue-typescript instead So they do not need to handle SFC parsing and edit range mapping.
Shayan.To — 06/13/2022 Does vue-typescript also support vue 2?
johnsoncodehk — 06/13/2022 If just for organize imports, yes
So it seems like you can entrust the work of parsing and modifying Vue file to vue-tsc
project.
Issue Analytics
- State:
- Created a year ago
- Comments:17 (14 by maintainers)
Top Results From Across the Web
Using Vue with TypeScript - Vue.js
To get Vue SFCs and TypeScript working together, Volar creates a separate TS language service instance patched with Vue-specific support, and uses it...
Read more >How to use typescript correctly? · Issue #255 · vuejs/vue-test ...
I have recently started writing Vue unit tests using Jest + Typescript + Vue test utils, however i'm facing an issue where passing...
Read more >How To Use TypeScript with Vue Single File Components
In this tutorial, you will use @vue/cli to generate a new Vue.js 2.0 application with TypeScript and build a Single-File Component (SFC).
Read more >VSCode showing "cannot find module" TS error for .vue import ...
For me, for a Vite & Vue 3 project in PhpStorm it was enough to create a shims file in the src directory....
Read more >volar/vue-typescript - NPM Package Versions - Socket.dev
Version: 0.39.5 was published by johnsoncodehk. Start using Socket to analyze @volar/vue-typescript and its 3 dependencies to secure your ...
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
It’s here: https://github.com/johnsoncodehk/volar/blob/4e6f6f77c589e39c1139a323fa75a7633eceadc4/packages/vue-typescript/src/types.ts#L9-L22
But
getVueCompilationSettings() { return {} }
is good enough for use the organize imports api.@Shayan-To Yes please open an issue to Volar repo, repro link is not needed, but please describe current behavior and expected behavior.