Vue · VUE0016

Prefer TypeScript props declarations

Use type-only defineProps declarations in TypeScript <script setup> components.
VUE0016vite-doctor/vuestylewarnSuggestion

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.

Use defineProps<Props>() or defineProps<{ foo: string }>() instead of runtime props objects when the component already uses TypeScript.

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>
Copyright © 2026