Closed Shinigami92 closed 3 years ago
This is expected, you should change src="./App.ts"
to src="./App"
.
Didn't know that this is possible 😃
Works now 👍, but the error message is misleading Is it possible to change it?
So if lang="ts"
then error message equals:
src/App.vue:2:23 - error TS2691: An import path cannot end with a '.ts' extension. Consider importing './App' instead.
Thanks for suggestion, but lang="ts"
is no relationship with src
, something like <script lang="ts" src="./App.js">
is also working.
btw I recommend you use Volar for code checking, vue-tsc is use for pipeline.
This is for pipeline 🙂
I just added it to my build
script
I cannot use Volar
right now, cause it's a Vue 2 application 🙂
Actually vue-tsc is use for vue 3 too, it has totally same type-checking result with volar.
Anyway if you want to use volar on vue 2 project, you could install @vue/runtime-dom
, see: https://github.com/johnsoncodehk/volar#using
I have following folder/file structure:
When referencing a
.ts
file withlang
set tots
,vue-tsc
should check it's content withtsc