@html-eslint/parser
Advanced tools
Comparing version 0.10.0 to 0.10.1
@@ -19,16 +19,11 @@ const { | ||
process(node) { | ||
if (node.type === "#document") { | ||
this.processOnDocument(node); | ||
if (typeof this[node.type] === "function") { | ||
this[node.type](node); | ||
} | ||
if (node.type === "#text") { | ||
this.processOnText(node); | ||
} | ||
if (node.type === "#comment") { | ||
this.processOnComment(node); | ||
} | ||
if (node.type === "#documentType") { | ||
this.processOnDocumentType(node); | ||
} | ||
this.processOnCommonNode(node); | ||
return node; | ||
} | ||
processOnCommonNode(node) { | ||
if (Array.isArray(node.childNodes)) { | ||
@@ -46,6 +41,5 @@ node.childNodes.forEach((child) => { | ||
delete node.parentNode; | ||
return node; | ||
} | ||
processOnDocument(node) { | ||
["#document"](node) { | ||
const locNode = getLocFromChildNodes(node.childNodes); | ||
@@ -60,3 +54,3 @@ node.type = "Program"; | ||
processOnText(node) { | ||
["#text"](node) { | ||
this.skipCommonProcess = true; | ||
@@ -67,3 +61,3 @@ node.type = "text"; | ||
processOnComment(node) { | ||
["#comment"](node) { | ||
this.skipCommonProcess = true; | ||
@@ -93,3 +87,3 @@ node.type = "comment"; | ||
processOnDocumentType(node) { | ||
["#documentType"](node) { | ||
node.type = "documentType"; | ||
@@ -99,2 +93,10 @@ this.skipCommonProcess = true; | ||
["template"](node) { | ||
if (!Array.isArray(node.childNodes)) { | ||
node.childNodes = []; | ||
} | ||
node.childNodes.push(...node.content.childNodes); | ||
delete node.content; | ||
} | ||
processOnNode(node) { | ||
@@ -101,0 +103,0 @@ if (node.type[0] === "#") { |
{ | ||
"name": "@html-eslint/parser", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "Parser for @html-eslint/eslint-plugin", | ||
@@ -32,3 +32,3 @@ "author": "yeonjuan", | ||
}, | ||
"gitHead": "27a9558d936c67cb9e11df1b40a84d7b96bbbb43" | ||
"gitHead": "827103223429c0a629d2823512df21fdf511edb5" | ||
} |
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
372595
26934