0

I have a Vue3 app and using VSCode. Using the npm run type-check command will show me the vue-tsc errors. I'm trying to find a way to show these errors in VSCode, like eslint does.

Does anybody know if this possible?

I have the lastest versions of typescript, vue and vue-tsc npm packages, as well as VSCode and the Vue - Official extension.

0

2 Answers 2

0

Go to this part of the documentation, and give a try to the following snippet

<script setup lang="ts">
import { ref } from 'vue'
const count = ref('1')
</script>

<template>
  {{ count.toFixed(2) }}
</template>

With the official Vue VScode extension (using Volar behind the scenes) + brand new project generated with the Vue CLI, it should work well (works even without asking for TS during the project creation on my side).

enter image description here

Feel free to share a Github repo if it doesn't.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for your response. I fixed it accidentally when I tried to fix other issues and changed the tsconfig.json rootDir and baseUrl values.
0

The issue was that the rootDir and baseUrl values were not configured correctly in the tsconfig.app.json file.

After changing these settings to the correct values, I get the errors and warnings in VSCode from Volar.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.