Skip to content

Commit 501a409

Browse files
authored
Fix #637 - Don't ignore elements with "is" binding in component-name-in-template-casing (#644)
1 parent 023121c commit 501a409

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

lib/rules/component-name-in-template-casing.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module.exports = {
6161
return
6262
}
6363

64-
if (!utils.isCustomComponent(node)) {
64+
if (!utils.isHtmlElementNode(node) || utils.isHtmlWellKnownElementName(node.rawName)) {
6565
return
6666
}
6767

tests/lib/rules/component-name-in-template-casing.js

+19
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ tester.run('component-name-in-template-casing', rule, {
2727
'<template><svg><path/></svg></template>',
2828
'<template><math><mspace/></math></template>',
2929
'<template><div><slot></slot></div></template>',
30+
'<template><h1>Title</h1></template>',
31+
'<template><h1 :is="customTitle">Title</h1></template>',
3032

3133
// kebab-case
3234
{
@@ -80,6 +82,23 @@ tester.run('component-name-in-template-casing', rule, {
8082
`,
8183
errors: ['Component name "the-component" is not PascalCase.']
8284
},
85+
{
86+
code: `
87+
<template>
88+
<the-component :is="componentName">
89+
content
90+
</the-component>
91+
</template>
92+
`,
93+
output: `
94+
<template>
95+
<TheComponent :is="componentName">
96+
content
97+
</TheComponent>
98+
</template>
99+
`,
100+
errors: ['Component name "the-component" is not PascalCase.']
101+
},
83102
{
84103
code: `
85104
<template>

0 commit comments

Comments
 (0)