Skip to content

Commit

Permalink
Fix vuejs#637 - Don't ignore elements with "is" binding in component-…
Browse files Browse the repository at this point in the history
…name-in-template-casing (vuejs#644)
  • Loading branch information
michalsnik committed Nov 11, 2018
1 parent 023121c commit 501a409
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/component-name-in-template-casing.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module.exports = {
return
}

if (!utils.isCustomComponent(node)) {
if (!utils.isHtmlElementNode(node) || utils.isHtmlWellKnownElementName(node.rawName)) {
return
}

Expand Down
19 changes: 19 additions & 0 deletions tests/lib/rules/component-name-in-template-casing.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ tester.run('component-name-in-template-casing', rule, {
'<template><svg><path/></svg></template>',
'<template><math><mspace/></math></template>',
'<template><div><slot></slot></div></template>',
'<template><h1>Title</h1></template>',
'<template><h1 :is="customTitle">Title</h1></template>',

// kebab-case
{
Expand Down Expand Up @@ -80,6 +82,23 @@ tester.run('component-name-in-template-casing', rule, {
`,
errors: ['Component name "the-component" is not PascalCase.']
},
{
code: `
<template>
<the-component :is="componentName">
content
</the-component>
</template>
`,
output: `
<template>
<TheComponent :is="componentName">
content
</TheComponent>
</template>
`,
errors: ['Component name "the-component" is not PascalCase.']
},
{
code: `
<template>
Expand Down

0 comments on commit 501a409

Please sign in to comment.