Vue · VUE0016
Prefer TypeScript props declarations
Use type-only defineProps declarations in TypeScript <script setup> components.
Run this rule
pnpm vite-doctor . --framework vue --rules vue/style/prefer-type-props
Why it matters
Runtime prop declarations duplicate information TypeScript can already express, and they make prop contracts harder to reuse across components, composables, and tests.
Recommended fix
Use defineProps<Props>() or defineProps<{ foo: string }>() instead of runtime props objects when the component already uses TypeScript.
Useful links
Example
Declare props with TypeScript
Before
<script setup lang="ts">
const props = defineProps({
title: String,
count: Number,
})
</script>
After
<script setup lang="ts">
interface Props {
title: string
count?: number
}
const props = defineProps<Props>()
</script>