Skip to content

Commit 7bb5438

Browse files
ota-meshimichalsnik
authored andcommitted
Fixed #648 (#649)
1 parent 176aa8b commit 7bb5438

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/rules/valid-v-model.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ module.exports = {
156156
context.report({
157157
node,
158158
loc: node.loc,
159-
message: "'v-model' directives cannot update the iteration variable 'x' itself."
159+
message: "'v-model' directives cannot update the iteration variable '{{varName}}' itself.",
160+
data: { varName: id.name }
160161
})
161162
}
162163
}

tests/lib/rules/valid-v-model.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ tester.run('valid-v-model', rule, {
161161
filename: 'test.vue',
162162
code: '<template><div><div v-for="x in list"><input v-model="(((x)))"></div></div></template>',
163163
errors: ["'v-model' directives cannot update the iteration variable 'x' itself."]
164+
},
165+
{
166+
filename: 'test.vue',
167+
code: '<template><div><div v-for="e in list"><input v-model="e"></div></div></template>',
168+
errors: ["'v-model' directives cannot update the iteration variable 'e' itself."]
164169
}
165170
]
166171
})

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy