pageClass | sidebarDepth | title | description |
---|---|---|---|
rule-details |
0 |
vue/prefer-type-props-decl |
enforce type-based `defineProps` |
enforce type-based
defineProps
- ❗ This rule has not been released yet.
This rule forces developers to use the type-based declaration of defineProps
instead of runtime declaration.
This rule only works in setup script and lang="ts"
.
<script setup lang="ts">
/* ✓ GOOD */
const props = defineProps<{
kind: string
}>()
</script>
<script setup lang="ts">
/* ✗ BAD */
const props = defineProps({
kind: { type: String }
})
</script>
Nothing.