Open RobertOrthofer opened 4 years ago
Please use vti
for type checking in .vue
files.
See https://github.com/vuejs/vetur/issues/1635
Maybe we need to document this somewhere.
Meet the same problem, +1
Try vue-tsc
Try
vue-tsc
Thanks a lot.
If you're coming to this issue because you've made a blatant error (eg. const a : number = "im a satring") in a .vue file and running npm run build (vue-cli-service build) doesnt report any errors here's what you need to do:
@vue/cli-plugin-typescript
is up to date (the number in package.json DOES NOT NECESSARILY represent the actual version you have installed)NOTE: I'm using vue 2
# check your installed ts plugin version
npm list --depth 0 @vue/cli-plugin-typescript
#bad output
└── @vue/cli-plugin-typescript@4.3.1 # <----- THIS IS BAD, TOO OLD VERSION
# how to fix
npm i -D @vue/cli-plugin-typescript@4.5.13
# now "npm list" should show
└── @vue/cli-plugin-typescript@4.5.13
#the version can sometimes be old even after the force npm install - if that's the case make sure to update the version in package.json also
After doing the above I have regular ts errors in .vue files when I do something stupid
🚧 WIP. This feature is not stable yet. 🚧
So, for just now, there is no good enough solution.
🚧 WIP. This feature is not stable yet. 🚧 from https://vuejs.github.io/vetur/guide/vti.html
So, for just now, there is no good enough solution.
Shouldn't vue-tsc
now be compatible with vue 2.7.6
?
vue-tsc
worked for me with vue@2.6.14
I can run vue-tsc --noEmit
, but vue-tsc --watch
does not work. I was hoping vue-cli would swap it's watch mechanism to use vue-tsc
Version
4.1.1
Reproduction link
https://github.com/RobertOrthofer/typescript-vue
Environment info
Steps to reproduce
What is expected?
The computed property foo in HelloWorld.vue has an incorrect return type.
npm run typecheck
should report that error like vetur does in VS CodeWhat is actually happening?
When running
npm run typecheck
no errors are shown.Is there a way to configure the repository so typescript does not ignore .vue files? Our goal is to run typechecking in a CI.