Vue + TypeScript: VSCode don't show all errors

Viewed 598

So I have a Vue project and use TypeScript classes for the Vue components. For example, a .vue file looks like this:


import Component from 'vue-class-component';
import Vue from 'vue';
import { Prop } from 'vue-property-decorator';

@Component
export default class GameInput extends Vue {
  @Prop({ default: 'text' }) readonly type!: string;
  @Prop({ default: '' }) readonly placeholder!: string;
  @Prop({ default: '' }) readonly value!: string;
  @Prop({ required: false }) readonly max!: number;

  updateValue(value): void {
    this.$emit('input', value);
  }
}

In Visual Studio Code I get no error when viewing the file, but when building it with npm run build I get the following error message:

Parameter 'value' implicitly has an 'any' type.

When I copy the typescript code from the .vue file in its own .ts file, vscode shows me the error. But not in a .vue file. Most other errors are displayed. For example, if I remove the void return type in the method, I get

Missing return type on function.eslint@typescript-eslint/explicit-function-return-type

So my question is: How can I get VSCode to show me all possible error. Especially the 'implicitly any' error.

0 Answers
Related