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.

Use `vue-typescript` (from Volar) for supporting vue, instead of directly using sfc compiler

See original GitHub issue

I 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:closed
  • Created a year ago
  • Comments:17 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
johnsoncodehkcommented, Jun 16, 2022

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.

0reactions
johnsoncodehkcommented, Jun 17, 2022

@Shayan-To Yes please open an issue to Volar repo, repro link is not needed, but please describe current behavior and expected behavior.

Read more comments on GitHub >

github_iconTop 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 >

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