Open DerAlbertCom opened 6 years ago
I noticed the same thing when I just spun up a template project with vue-cli 3.0. Which I guess is just a requirement (as listed on the quickstart.)
I'm experiencing this too, and it's driving me mad. I think I need to remove the extension.
I noticed the same thing too. If I disable the extension, I can't find another one to lint Vue SFC.
Fixed it.
Turns out I had some bad code. Make sure that:
<script lang="ts">
. I had mixed script blocks, some just plain JS. This was causing issues. And BTW, this is not a bug with this extension, but rather VS Code's parser, it seems.Happens even in an SFC without script tags.
@Nfinished Right. There's nothing wrong with this file, obviously, but it's other files affecting this one. (see my post above yours)
𝓬𝓻𝓲𝓹𝓮𝓼
I know, tell me about it. I spent hours trying to figure out what was wrong. I still don't understand why having some components use JS and some use TS is a problem. But it was causing issues in VS Code, as Prettier wouldn't work either.
I will say this, though: it's not possible to have a .vue file without a <script>
block. I have to add <script lang="ts"></script>
just to shut up the "missing semicolon" bug.
@prograhammer Is this something you could address?
Woops. Actually, all this code was needed:
<script lang="ts">
import Vue from 'vue';
export default Vue.extend();
</script>
Otherwise, main.ts
was yelling at me because it didn't like App.vue
being imported.
I use this extension together with eslint-plugin-vue
and eslint
to get template linting in .vue files. I have vue/html-self-closing enabled.
It works fine most of the time, but as soon as you have a component with self-closing <textarea />
or <iframe />
(maybe some other tags) it will start reporting [tslint] Missing semicolon (semicolon)
. Auto-fixing further will break syntax.
Before:
<template>
<textarea />
</template>
<script lang="ts">
import Vue from "vue";
export default Vue.extend({});
</script>
After:
<template>
<te"vue"a />
</template>
<;script lang="ts">
import Vue from "vue";
export default Vue.extend({});
</script>
After it becomes very annoying I temporarily disable auto-fixing, or execute VSCode's save without formatting.
When a .vue template is missing the the ts-line-vue has false positive warnings
expected behavior is no warnings in that case, like here