I have a problem. When there is a TypeScript error in the code, there is an error in the IDE, but I anyways can save it and run in the browser. Is it okay?
Here is the code:
<script lang="ts" setup>
const a = ref<string>(5);
</script>
I tried export default and export default defineComponent(), but it didn't help.
Here is the screenshoot of my IDE
As stated on the nuxt 3 documentation typescript/type-checking:
By default, Nuxt doesn't check types when you run nuxi dev or nuxi build, for performance reasons.
If you want to enable it, you need to:
vue-tsc
and typescript
as devDependencies
nuxt.config.js
:typescript: {
typeCheck: true,
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With