Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule no-setup-props-reactivity-loss in Vue 3.5 should no longer trigger a warning when destructuring defineProps. #2543

Closed
heggria opened this issue Sep 4, 2024 · 2 comments

Comments

@heggria
Copy link

heggria commented Sep 4, 2024

What rule do you want to change?

no-setup-props-reactivity-loss

Does this change cause the rule to produce more or fewer warnings?

fewer

How will the change be implemented? (New option, new default behavior, etc.)?

In vue 3.5, variables destructured from props will retain reactivity, so this warning is incorrect in this context.

Please provide some example code that this change will affect:

Playground

// before: warning "Destructuring the `props` will cause the value to lose reactivity."
const { name, className = '', height = '14', width = '14' } = defineProps<{
    name: string
    className?: string
    height?: string | number
    width?: string | number
}>()

// after: no warning in vue 3.5 
const { name, className = '', height = '14', width = '14' } = defineProps<{
    name: string
    className?: string
    height?: string | number
    width?: string | number
}>()
@n0099
Copy link

n0099 commented Sep 6, 2024

#2121

@FloEdelmann
Copy link
Member

Thanks for linking that issue! I'll close this as a duplicate then.

@FloEdelmann FloEdelmann closed this as not planned Won't fix, can't repro, duplicate, stale Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants