@html-eslint/eslint-plugin
Advanced tools
Comparing version 0.6.4 to 0.6.5
@@ -14,2 +14,3 @@ /** | ||
UL: "Ul", | ||
SCRIPT: "Script", | ||
}; |
@@ -118,3 +118,3 @@ /** | ||
} | ||
let isInPre = false; | ||
let ignoreChildren = false; | ||
return { | ||
@@ -125,4 +125,8 @@ /** | ||
"*"(node) { | ||
if (node.type === NODE_TYPES.PRE || isInPre) { | ||
isInPre = true; | ||
if ( | ||
node.type === NODE_TYPES.PRE || | ||
node.type === NODE_TYPES.SCRIPT || | ||
ignoreChildren | ||
) { | ||
ignoreChildren = true; | ||
return; | ||
@@ -157,4 +161,7 @@ } | ||
"Pre:exit"() { | ||
isInPre = false; | ||
ignoreChildren = false; | ||
}, | ||
"Script:exit"() { | ||
ignoreChildren = false; | ||
}, | ||
"*:exit"() { | ||
@@ -161,0 +168,0 @@ indentLevel.down(); |
const { RULE_CATEGORY, NODE_TYPES } = require("../constants"); | ||
const { OBSOLETE_TAGS } = require("../constants"); | ||
const OBSOLETE_TAGS_SET = new Set(OBSOLETE_TAGS); | ||
const MESSAGE_IDS = { | ||
@@ -31,3 +33,3 @@ UNEXPECTED: "unexpected", | ||
node.tagName && | ||
OBSOLETE_TAGS.includes(node.tagName) | ||
OBSOLETE_TAGS_SET.has(node.tagName) | ||
) { | ||
@@ -34,0 +36,0 @@ context.report({ |
const { RULE_CATEGORY, VOID_ELEMENTS } = require("../constants"); | ||
const VOID_ELEMENTS_SET = new Set(VOID_ELEMENTS); | ||
const MESSAGE_IDS = { | ||
@@ -101,3 +103,3 @@ MISSNG: "missing", | ||
if (node.startTag) { | ||
if (VOID_ELEMENTS.includes(node.tagName)) { | ||
if (VOID_ELEMENTS_SET.has(node.tagName)) { | ||
checkSelfClosing(node); | ||
@@ -104,0 +106,0 @@ } else { |
const { RULE_CATEGORY, ISO_639_1 } = require("../constants"); | ||
const { NodeUtils } = require("./utils"); | ||
const ISO_639_1_SET = new Set(ISO_639_1); | ||
const MESSAGE_IDS = { | ||
@@ -36,3 +38,3 @@ MISSING_LANG: "missingLang", | ||
}); | ||
} else if (!ISO_639_1.includes(langAttr.value)) { | ||
} else if (!ISO_639_1_SET.has(langAttr.value)) { | ||
context.report({ | ||
@@ -39,0 +41,0 @@ node: node.startTag, |
@@ -16,2 +16,3 @@ export type RuleCategory = { | ||
UL: "Ul"; | ||
SCRIPT: "Script"; | ||
}; | ||
@@ -18,0 +19,0 @@ |
{ | ||
"name": "@html-eslint/eslint-plugin", | ||
"version": "0.6.4", | ||
"version": "0.6.5", | ||
"description": "ESLint plugin for html", | ||
@@ -44,3 +44,3 @@ "author": "yeonjuan", | ||
}, | ||
"gitHead": "7bf44dd54aa92eed588408aecccf23bed9c855e8" | ||
"gitHead": "db6c66935e2ee0e2a5febce3f51bc7cc1bb589e0" | ||
} |
40858
1490