You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What rule do you want to change?
vue/no-setup-props-destructure Does this change cause the rule to produce more or fewer warnings?
More. How will the change be implemented? (New option, new default behavior, etc.)?
Perhaps an option that defaults to false would be best for backwards compatibility, though arguably it's more correct for it to be the default behavior. Please provide some example code that this change will affect:
What does the rule currently do for this code?
Nothing. What will the rule do after it's changed?
Flag it as a loss of reactivity. It should be foo(toRef(props, "foo")) or foo(computed(() => props.foo)) instead. Additional context
The rule already flags code like const foo = props.foo. Passing it to a function incurs the same loss of reactivity, so it seems consistent to flag that as well. Note also that vue/no-ref-object-destructure already flags something like foo(bar.value) and that seems like an analogous case.
The text was updated successfully, but these errors were encountered:
FloEdelmann
changed the title
vue/no-setup-props-destructure should trigger when prop is passed to functionvue/no-setup-props-destructure should trigger when prop is passed to function
Feb 27, 2023
What rule do you want to change?
vue/no-setup-props-destructure
Does this change cause the rule to produce more or fewer warnings?
More.
How will the change be implemented? (New option, new default behavior, etc.)?
Perhaps an option that defaults to false would be best for backwards compatibility, though arguably it's more correct for it to be the default behavior.
Please provide some example code that this change will affect:
What does the rule currently do for this code?
Nothing.
What will the rule do after it's changed?
Flag it as a loss of reactivity. It should be
foo(toRef(props, "foo"))
orfoo(computed(() => props.foo))
instead.Additional context
The rule already flags code like
const foo = props.foo
. Passing it to a function incurs the same loss of reactivity, so it seems consistent to flag that as well. Note also that vue/no-ref-object-destructure already flags something likefoo(bar.value)
and that seems like an analogous case.The text was updated successfully, but these errors were encountered: