pageClass | sidebarDepth | title | description |
---|---|---|---|
rule-details |
0 |
vue/force-types-on-object-props |
enforce user to add type declaration to object props |
enforce user to add type declaration to object props
- ❗ This rule has not been released yet.
- ⚙️ This rule is included in all of
"plugin:vue/base"
,"plugin:vue/essential"
,"plugin:vue/vue3-essential"
,"plugin:vue/strongly-recommended"
,"plugin:vue/vue3-strongly-recommended"
,"plugin:vue/recommended"
and"plugin:vue/vue3-recommended"
.
Prevent missing type declaration of not primitive objects in a TypeScript projects.
Bad:
export default {
props: {
prop: {
type: Object,
},
},
}
export default {
props: {
prop: {
type: Array
}
}
}
Good:
export default {
props: {
prop: {
type: Object as Props<Anything>,
}
}
}
export default {
props: {
prop: {
type: String, // or any other primitive type
}
}
}
Nothing.
When you're not using TypeScript in the project****.
Nothing