diff --git a/lib/rules/component-name-in-template-casing.js b/lib/rules/component-name-in-template-casing.js
index 65a6f3122..df06a0b1c 100644
--- a/lib/rules/component-name-in-template-casing.js
+++ b/lib/rules/component-name-in-template-casing.js
@@ -90,23 +90,21 @@ module.exports = {
return false
}
+ if (
+ (!utils.isHtmlElementNode(node) && !utils.isSvgElementNode(node)) ||
+ utils.isHtmlWellKnownElementName(node.rawName) ||
+ utils.isSvgWellKnownElementName(node.rawName)
+ ) {
+ return false
+ }
+
if (!registeredComponentsOnly) {
// If the user specifies registeredComponentsOnly as false, it checks all component tags.
- if (
- (!utils.isHtmlElementNode(node) && !utils.isSvgElementNode(node)) ||
- utils.isHtmlWellKnownElementName(node.rawName) ||
- utils.isSvgWellKnownElementName(node.rawName)
- ) {
- return false
- }
- return true
- }
- // We only verify the registered components.
- if (registeredComponents.has(casing.pascalCase(node.rawName))) {
return true
}
- return false
+ // We only verify the registered components.
+ return registeredComponents.has(casing.pascalCase(node.rawName))
}
let hasInvalidEOF = false
diff --git a/tests/lib/rules/component-name-in-template-casing.js b/tests/lib/rules/component-name-in-template-casing.js
index 758254b97..d57a5ffbf 100644
--- a/tests/lib/rules/component-name-in-template-casing.js
+++ b/tests/lib/rules/component-name-in-template-casing.js
@@ -162,6 +162,15 @@ tester.run('component-name-in-template-casing', rule, {
`
},
+ {
+ code: `
+
+
+ `,
+ options: ['PascalCase'],
+ filename: 'test.vue'
+ },
+
// globals
{
code: `