During the process of migrating the application from Vue 2 to Vue 3 by following this guide: , I encountered an issue related to Props and their types. All props were marked as type unknown by the linter, even though no errors were shown in the template itself.
For example, I have a prop called "cancelText" defined like this:
cancelText: {
type: String as PropType<string>,
default: "",
},
And then I used this prop inside a computed property like this:
cancelButtonText(): string {
return this.cancelText || this.$t("PRODUCT.ACTION_BAR.BACK");
},
When hovering over the variable, the type is shown correctly, indicating that it understands the type: https://i.sstatic.net/R6KPQ.png
However, when serving the application, I encountered this error in the terminal:
TS2322: Type 'unknown' is not assignable to type 'string'.
https://i.sstatic.net/ddjaV.png
It seems like either some package is not compatible or certain linting rules need to be updated specifically for Vue 3.
Here are the dependencies being used:
"dependencies": {
// List of dependencies
},
"devDependencies": {
// List of dev dependencies
},
And the ESLint rules being followed:
module.exports = {
// Configuration for ESLint rules
},