Vue · Architecture

VUE0039Remove props no caller passes

Finds declared Vue props that no resolved caller in the project ever passes.

Why it happens

A prop that no caller passes always renders with its default value or undefined, so its type, default, and the branches that read it are contract surface no caller exercises. Doctor reports it only when every usage of the component is visible: the component has resolved template callers, none spreads props into it with v-bind, no script module, re-export, dynamic import, or render function reaches it, no unresolved tag could render it, and it is not part of a package that declares entry points. Test files are outside the analyzed source, so a prop only tests pass is still reported.

Fix

Remove the prop from defineProps and use the value it always has inside the component, or pass it from the caller that needs it. Keep it when code Doctor cannot see renders the component, such as another package, a global registration, or a render function.

Example

Drop a prop no caller passes

Before

<!-- ActionButton.vue -->
<script setup lang="ts">
const { size = 'md' } = defineProps<{ label: string; size?: 'sm' | 'md' }>()
</script>

<!-- Every caller -->
<template>
  <ActionButton label="Save" />
</template>

After

<!-- ActionButton.vue -->
<script setup lang="ts">
defineProps<{ label: string }>()
</script>

<!-- Every caller -->
<template>
  <ActionButton label="Save" />
</template>

Verify the fix

Run only this rule after editing so the report stays focused on the diagnostic you are closing:

pnpm vite-doctor . --framework vue --extends auto,vue/strict --rules vue/props/no-unpassed-props
Copyright © 2026