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

Only allow modelValue in vue/no-deprecated-model-definition #2255

Merged
merged 1 commit into from
Jul 29, 2023

Conversation

FloEdelmann
Copy link
Member

@FloEdelmann FloEdelmann commented Jul 28, 2023

Follow-up to #2238.

I now tested the (unreleased) rule in a large codebase that is currently prepared for upgrading to Vue 3. There, I noticed that allowing anything different than modelValue/update:modelValue or model-value/update:model-value does not make sense: You'd still need to change v-model to v-model:fooBar in the actual Vue 3 migration if your model specified fooBar/update:fooBar.

So it's better to either rename the model definition to modelValue/update:modelValue or model-value/update:model-value and keep using v-model, or to rename the model definition to fooBar/update:fooBar and also update all v-models to :fooBar="…" @update:fooBar="… = $event", and after the Vue 3 migration change it to v-model:fooBar with #2237.

Therefore, I changed the rule and the suggestions to only allow modelValue/update:modelValue or model-value/update:model-value.

@FloEdelmann FloEdelmann changed the title vue/no-deprecated-model-definition compat mode: only allow modelValue Only allow modelValue in vue/no-deprecated-model-definition compat Jul 28, 2023
@FloEdelmann FloEdelmann changed the title Only allow modelValue in vue/no-deprecated-model-definition compat Only allow modelValue in vue/no-deprecated-model-definition Jul 28, 2023
@ota-meshi ota-meshi merged commit b8814c7 into master Jul 29, 2023
14 checks passed
@ota-meshi ota-meshi deleted the deprecated-model branch July 29, 2023 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants