Socket
Socket
Sign inDemoInstall

eslint-plugin-vue

Package Overview
Dependencies
Maintainers
3
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-vue - npm Package Compare versions

Comparing version 3.2.1 to 3.2.2

21

lib/rules/no-invalid-template-root.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc