Vue + TypeScript: type-checking is not working at all in script block
In my script block (which has lang="ts"), I have the following code:
let foo = 2;
foo = 'hi';
It's not complaining about this at all. Also, whenever I use interfaces I've created, it doesn't validate use of those types either:
const thisIsWrong: Track = {
huff: 'puff',
fake: 'field',
};
There are no problems in .ts files, only with .vue files.
Please sign in to leave a comment.
What IDE version do you work with? It works fine for me in 2020.2, with Typescript language service enabled:
and disabled:
It's working ok now! Really weird. I think restarting WebStorm might've fixed it.
Great, thanks for letting me know:)
This is happening for me too. A restart and an Invalidate Cache/Restart isn't working for me. This has always happened in *.vue files.
Just to clarify, this happens inside a <script lang="ts"> block and it has Typescript language service enabled.