Skip to content

Commit 2bdcc51

Browse files
authored
Ignore <Textarea> components in vue/no-textarea-mustache (#2024)
1 parent c64af6b commit 2bdcc51

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Diff for: lib/rules/no-textarea-mustache.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = {
2222
create(context) {
2323
return utils.defineTemplateBodyVisitor(context, {
2424
/** @param {VExpressionContainer} node */
25-
"VElement[name='textarea'] VExpressionContainer"(node) {
25+
"VElement[rawName='textarea'] VExpressionContainer"(node) {
2626
if (node.parent.type !== 'VElement') {
2727
return
2828
}

Diff for: tests/lib/rules/no-textarea-mustache.js

+9
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ tester.run('no-textarea-mustache', rule, {
2222
{
2323
filename: 'test.vue',
2424
code: '<template><div><textarea v-model="text"></textarea></div></template>'
25+
},
26+
{
27+
filename: 'test.vue',
28+
code: '<template><div><Textarea>{{text}}</Textarea></div></template>'
2529
}
2630
],
2731
invalid: [
@@ -30,6 +34,11 @@ tester.run('no-textarea-mustache', rule, {
3034
code: '<template><div><textarea>{{text}}</textarea></div></template>',
3135
errors: ["Unexpected mustache. Use 'v-model' instead."]
3236
},
37+
{
38+
filename: 'test.vue',
39+
code: '<template><div><textarea v-model="text">{{text}}</textarea></div></template>',
40+
errors: ["Unexpected mustache. Use 'v-model' instead."]
41+
},
3342
{
3443
filename: 'test.vue',
3544
code: '<template><div><textarea>{{text}} and {{text}}</textarea></div></template>',

0 commit comments

Comments
 (0)