Vue · VUE0005
Watch destructured props with a getter
Finds Vue reactivity code that can be written with a clearer framework-supported pattern.
vue/reactivity/defineprops-watch-gettersrc/rule-packs/vue/rules/vue/define-props-watch-getter.ts Upstream docs Run this rule
pnpm vite-doctor . --framework vue --rules vue/reactivity/defineprops-watch-getter
Why it matters
Effects that outlive their component create leaks and stale updates. Register cleanup where Vue or VueUse can dispose it automatically.
Recommended fix
Use the Vue-supported defineProps watch getter pattern instead.
Useful links
Example
Watch props with getters
Before
<script setup lang="ts">
const props = defineProps<{ id: string }>()
watch(props.id, loadUser)
</script>
After
<script setup lang="ts">
const props = defineProps<{ id: string }>()
watch(() => props.id, loadUser)
</script>