-
-
Notifications
You must be signed in to change notification settings - Fork 681
vue/no-template-key, vue/valid-v-for need to be updated for vue-next 3.0.0-rc.6 #1279
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
Comments
Thank you for this issue. |
See also vuejs/core#1734 (comment) |
I missed that, sorry 😅 |
related: vuejs/core#1907 |
I considered changing this plugin to solve this problem. First, we need to make four changes:
Next, I think it's useful to add the following new rule for Vue3:
I welcome your opinions. If you have any opinions please comment this issue. I will work on these when I have time. |
Your proposals sound great to me. Can’t wait for these changes to be made!
…On Thu, Aug 20, 2020 at 7:14 PM Yosuke Ota ***@***.***> wrote:
I considered changing this plugin to solve this problem.
First, we need to make four changes:
- Change vue/no-template-key to allow v-for key. If you don't use v-for,
it will still report the key as an error.
- Change vue/valid-v-for rule to not report, both when placing a key
on <template> and when placing keys on child elements of <template>.
The reason we don't even report when placing keys on child elements is
to make the rule available in Vue2.
- Change vue/require-v-for-key rule to be the same as the
vue/valid-v-for rule.
- Add vue/no-v-for-template-key rule that disallow the key placed in
the <template v-for>. and add this rule to the category for Vue2. This
rule reports invalid use with Vue2.
Next, I think it's useful to add the following new rule for Vue3:
- Add vue/no-v-for-template-key-on-child rule that disallow the key
placed in the child elements of <template v-for>.
This rule reports an error similar to X_V_FOR_TEMPLATE_KEY_PLACEMENT.
I welcome your opinions. If you have any opinions please comment this
issue.
I will work on these when I have time.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1279 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB55Q2YWGOCU4F2EP6IQ73SBXDAXANCNFSM4QFOAPOQ>
.
|
Due to a vue compiler error, I was made aware that in Vue 3, :key can/should be placed directly on instead of the direct child element. I'm not sure when this changed, but a recent vue-next commit that is now part of 3.0.0-rc.6 now throws the error when compiling.
Re: vuejs/core@b0d01e9
Checklist
Tell us about your environment
What did you do?
What did you expect to happen?
No ESLint rule errors.
What actually happened?
The text was updated successfully, but these errors were encountered: