QUERY: I'm facing an issue with error
'validations' does not exist in type 'ComponentOptions<Vue [etc.]
when using Vetur with TypeScript installed in VSCode. How can I resolve this?
CONTEXT: I integrated Vuelidate into a single-file Vue component by adding a validations
property following the documentation. The project has TypeScript installed for improved intellisense in Vetur, although the <script>
sections are written in JavaScript. After adding the validations
prop, Vetur started showing the mentioned error along with breaking intellisense for methods like mount()
.
SNIPPET: Here is a simplified version of my code snippet where TypeScript installation is required to reproduce the Vetur error:
export default {
data() {
return {
name: '',
}
},
validations: {
name: {
required,
minLength: minLength(4)
},
}
}
ACTIONS TAKEN: I attempted to fix the issue by adding @ts-ignore
to the validations
property, but it did not solve the problem of broken intellisense for method calls.