Skip to content

Commit

Permalink
Ignore <Textarea> components in vue/no-textarea-mustache (#2024)
Browse files Browse the repository at this point in the history
  • Loading branch information
qmhc committed Oct 31, 2022
1 parent c64af6b commit 2bdcc51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/no-textarea-mustache.js
Expand Up @@ -22,7 +22,7 @@ module.exports = {
create(context) {
return utils.defineTemplateBodyVisitor(context, {
/** @param {VExpressionContainer} node */
"VElement[name='textarea'] VExpressionContainer"(node) {
"VElement[rawName='textarea'] VExpressionContainer"(node) {
if (node.parent.type !== 'VElement') {
return
}
Expand Down
9 changes: 9 additions & 0 deletions tests/lib/rules/no-textarea-mustache.js
Expand Up @@ -22,6 +22,10 @@ tester.run('no-textarea-mustache', rule, {
{
filename: 'test.vue',
code: '<template><div><textarea v-model="text"></textarea></div></template>'
},
{
filename: 'test.vue',
code: '<template><div><Textarea>{{text}}</Textarea></div></template>'
}
],
invalid: [
Expand All @@ -30,6 +34,11 @@ tester.run('no-textarea-mustache', rule, {
code: '<template><div><textarea>{{text}}</textarea></div></template>',
errors: ["Unexpected mustache. Use 'v-model' instead."]
},
{
filename: 'test.vue',
code: '<template><div><textarea v-model="text">{{text}}</textarea></div></template>',
errors: ["Unexpected mustache. Use 'v-model' instead."]
},
{
filename: 'test.vue',
code: '<template><div><textarea>{{text}} and {{text}}</textarea></div></template>',
Expand Down

0 comments on commit 2bdcc51

Please sign in to comment.