eslint-plugin-vue
Advanced tools
Comparing version 3.2.1 to 3.2.2
@@ -34,2 +34,3 @@ /** | ||
const hasSrc = utils.hasAttribute(node.startTag, 'src') | ||
const rootElements = [] | ||
@@ -41,3 +42,3 @@ let extraText = null | ||
if (child.type === 'VElement') { | ||
if (rootElements.length === 0) { | ||
if (rootElements.length === 0 && !hasSrc) { | ||
rootElements.push(child) | ||
@@ -58,4 +59,10 @@ vIf = utils.hasDirective(child.startTag, 'if') | ||
if (extraText != null) { | ||
if (hasSrc && (extraText != null || extraElement != null)) { | ||
context.report({ | ||
node: extraText || extraElement, | ||
loc: (extraText || extraElement).loc, | ||
message: "The template root with 'src' attribute is required to be empty." | ||
}) | ||
} else if (extraText != null) { | ||
context.report({ | ||
node: extraText, | ||
@@ -71,3 +78,3 @@ loc: extraText.loc, | ||
}) | ||
} else if (rootElements.length === 0) { | ||
} else if (rootElements.length === 0 && !hasSrc) { | ||
context.report({ | ||
@@ -99,10 +106,2 @@ node, | ||
} | ||
if (vIf) { | ||
const tag = rootElements[0].startTag | ||
context.report({ | ||
node: tag, | ||
loc: tag.loc, | ||
message: "The template root requires the next element which has 'v-else' directives if it has 'v-if' directives." | ||
}) | ||
} | ||
} | ||
@@ -109,0 +108,0 @@ } |
{ | ||
"name": "eslint-plugin-vue", | ||
"version": "3.2.1", | ||
"version": "3.2.2", | ||
"description": "Official ESLint plugin for Vue.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81369
2249