Soviut
Soviut

Reputation: 91545

How do I prevent Vetur and TypeScript from both showing typescript warnings in VSCode?

I'm working on a Vue2 project that uses TypeScript. I'm using VSCode with the Vetur and TypeScript extensions installed.

Whenever a TypeScript warning occurs, the VSCode overlay shows the identical warning being reported by both TypeScript and Vetur.

warnings

Additionally, any intellisense menus show the options twice.

intellisense

I'd like to keep both extensions installed. How can I get them to play nice with each other and only display the warnings once?

Upvotes: 2

Views: 2252

Answers (1)

Michal Levý
Michal Levý

Reputation: 37793

It may be because both extensions are using different versions of TS. Vetur has a setting to use the workspace version of TS (simply from node_modules) and I bet TS extension for VS will have something similar.

Also note that Vetur is no longer officially recommended tool to use with Vue+TS but Volar is - from my personal experience, it is really better and more actively develop (even have support for script setup with no perfect but pretty decent auto-conversion between Options API/Composition API and script setup)

While Volar says it is designed for Vue 3, it still works fine with Vue 2 and the composition API. So it should be safe to disable Vetur in VSCode if you have Volar enabled.

Upvotes: 3

Related Questions