pageClass | sidebarDepth | title | description |
---|---|---|---|
rule-details |
0 |
vue/force-types-on-object-props |
enforce adding type declarations to object props |
enforce adding type declarations 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 declarations for non-primitive object props in TypeScript projects.
export default {
props: {
prop: {
// ✗ BAD
type: Object,
type: Array,
// ✓ GOOD
type: Object as Props<Anything>,
type: String, // or any other primitive type
}
}
}
Nothing.
When you're not using TypeScript in the project.
Nothing