diff --git a/.changeset/silly-falcons-explain.md b/.changeset/silly-falcons-explain.md
new file mode 100644
index 000000000..0f4ed5415
--- /dev/null
+++ b/.changeset/silly-falcons-explain.md
@@ -0,0 +1,5 @@
+---
+"eslint-plugin-vue": patch
+---
+
+Fix `vue/valid-v-for` rule to allow empty value alias
diff --git a/lib/rules/valid-v-for.js b/lib/rules/valid-v-for.js
index 21781142b..dc9686fe3 100644
--- a/lib/rules/valid-v-for.js
+++ b/lib/rules/valid-v-for.js
@@ -163,7 +163,7 @@ module.exports = {
const key = lhs[1]
const index = lhs[2]
- if (value === null) {
+ if (value === null && !key) {
context.report({
node: expr,
messageId: 'invalidEmptyAlias'
diff --git a/tests/lib/rules/valid-v-for.js b/tests/lib/rules/valid-v-for.js
index 451b86811..b47ca59dc 100644
--- a/tests/lib/rules/valid-v-for.js
+++ b/tests/lib/rules/valid-v-for.js
@@ -46,6 +46,14 @@ tester.run('valid-v-for', rule, {
filename: 'test.vue',
code: '
'
},
+ {
+ filename: 'test.vue',
+ code: ''
+ },
+ {
+ filename: 'test.vue',
+ code: ''
+ },
{
filename: 'test.vue',
code: ''
@@ -183,11 +191,6 @@ tester.run('valid-v-for', rule, {
code: '',
errors: ["'v-for' directives require that attribute value."]
},
- {
- filename: 'test.vue',
- code: '',
- errors: ["Invalid alias ''."]
- },
{
filename: 'test.vue',
code: '',