@html-eslint/eslint-plugin
Advanced tools
Comparing version 0.9.0 to 0.10.0
@@ -50,3 +50,3 @@ const { RULE_CATEGORY } = require("../constants"); | ||
const checkNaminig = CONVENTION_CHECKERS[convention]; | ||
const checkNaming = CONVENTION_CHECKERS[convention]; | ||
@@ -56,3 +56,3 @@ return { | ||
const idAttr = NodeUtils.findAttr(node, "id"); | ||
if (idAttr && idAttr.value && !checkNaminig(idAttr.value)) { | ||
if (idAttr && idAttr.value && !checkNaming(idAttr.value)) { | ||
context.report({ | ||
@@ -59,0 +59,0 @@ node: idAttr, |
@@ -15,3 +15,3 @@ const requireLang = require("./require-lang"); | ||
const idNamingConvention = require("./id-naming-convention"); | ||
const noObsoluteTags = require("./no-obsolete-tags"); | ||
const noObsoleteTags = require("./no-obsolete-tags"); | ||
const requireClosingTags = require("./require-closing-tags"); | ||
@@ -26,2 +26,5 @@ const requireMetaDescription = require("./require-meta-description"); | ||
const noDuplicateAttrs = require("./no-duplicate-attrs"); | ||
const noAbstractRoles = require("./no-abstract-roles"); | ||
const requireButtonType = require("./require-button-type"); | ||
const noAriaHiddenBody = require("./no-aria-hidden-body"); | ||
@@ -43,3 +46,3 @@ module.exports = { | ||
"id-naming-convention": idNamingConvention, | ||
"no-obsolete-tags": noObsoluteTags, | ||
"no-obsolete-tags": noObsoleteTags, | ||
"require-closing-tags": requireClosingTags, | ||
@@ -54,2 +57,5 @@ "require-meta-description": requireMetaDescription, | ||
"no-duplicate-attrs": noDuplicateAttrs, | ||
"no-abstract-roles": noAbstractRoles, | ||
"require-button-type": requireButtonType, | ||
"no-aria-hidden-body": noAriaHiddenBody, | ||
}; |
const { RULE_CATEGORY } = require("../constants"); | ||
const MESSAGE_IDS = { | ||
EXTRA_BETWEEN: "unexpectBetween", | ||
EXTRA_AFTER: "unexpectAfter", | ||
EXTRA_BEFORE: "unexpectBefore", | ||
EXTRA_BETWEEN: "unexpectedBetween", | ||
EXTRA_AFTER: "unexpectedAfter", | ||
EXTRA_BEFORE: "unexpectedBefore", | ||
}; | ||
@@ -8,0 +8,0 @@ |
@@ -60,5 +60,5 @@ const { RULE_CATEGORY } = require("../constants"); | ||
const [valueStart, valueEnd] = getValueRange(attr); | ||
const openinig = getCodeIn([valueStart, valueStart + 1]); | ||
const opening = getCodeIn([valueStart, valueStart + 1]); | ||
const closing = getCodeIn([valueEnd - 1, valueEnd]); | ||
return [openinig, closing]; | ||
return [opening, closing]; | ||
} | ||
@@ -65,0 +65,0 @@ |
@@ -6,3 +6,3 @@ const { RULE_CATEGORY, VOID_ELEMENTS } = require("../constants"); | ||
const MESSAGE_IDS = { | ||
MISSNG: "missing", | ||
MISSING: "missing", | ||
MISSING_SELF: "missingSelf", | ||
@@ -17,3 +17,3 @@ UNEXPECTED: "unexpected", | ||
docs: { | ||
description: "Reqiure closing tags.", | ||
description: "Require closing tags.", | ||
category: RULE_CATEGORY.BEST_PRACTICE, | ||
@@ -36,3 +36,3 @@ recommended: true, | ||
messages: { | ||
[MESSAGE_IDS.MISSNG]: "Missing closing tag for {{tag}}.", | ||
[MESSAGE_IDS.MISSING]: "Missing closing tag for {{tag}}.", | ||
[MESSAGE_IDS.MISSING_SELF]: "Missing self closing tag for {{tag}}", | ||
@@ -61,3 +61,3 @@ [MESSAGE_IDS.UNEXPECTED]: "Unexpected self closing tag for {{tag}}.", | ||
}, | ||
messageId: MESSAGE_IDS.MISSNG, | ||
messageId: MESSAGE_IDS.MISSING, | ||
}); | ||
@@ -64,0 +64,0 @@ } |
@@ -6,3 +6,3 @@ // @ts-check | ||
const MESSAGE_IDS = { | ||
MISSNG: "missing", | ||
MISSING: "missing", | ||
EMPTY: "empty", | ||
@@ -24,3 +24,3 @@ }; | ||
messages: { | ||
[MESSAGE_IDS.MISSNG]: "Missing `lang` attribute in `<html>` tag.", | ||
[MESSAGE_IDS.MISSING]: "Missing `lang` attribute in `<html>` tag.", | ||
[MESSAGE_IDS.EMPTY]: "Unexpected empty `lang` in in `<html>` tag.", | ||
@@ -37,3 +37,3 @@ }, | ||
node: node.startTag, | ||
messageId: MESSAGE_IDS.MISSNG, | ||
messageId: MESSAGE_IDS.MISSING, | ||
}); | ||
@@ -40,0 +40,0 @@ } else if (langAttr.value.trim().length === 0) { |
@@ -24,3 +24,3 @@ const { RULE_CATEGORY, NODE_TYPES } = require("../constants"); | ||
[MESSAGE_IDS.EMPTY]: | ||
'Unexpected emtpy `conetnt` in `<meta name="description">`', | ||
'Unexpected empty `content` in `<meta name="description">`', | ||
}, | ||
@@ -35,3 +35,3 @@ }, | ||
); | ||
const descripMetaTags = metaTags.filter((meta) => { | ||
const descriptionMetaTags = metaTags.filter((meta) => { | ||
const nameAttr = NodeUtils.findAttr(meta, "name"); | ||
@@ -41,3 +41,3 @@ return !!nameAttr && nameAttr.value.toLowerCase() === "description"; | ||
if (descripMetaTags.length === 0) { | ||
if (descriptionMetaTags.length === 0) { | ||
context.report({ | ||
@@ -48,3 +48,3 @@ node, | ||
} else { | ||
descripMetaTags.forEach((meta) => { | ||
descriptionMetaTags.forEach((meta) => { | ||
const content = NodeUtils.findAttr(meta, "content"); | ||
@@ -51,0 +51,0 @@ if (!content || !content.value.trim().length) { |
{ | ||
"name": "@html-eslint/eslint-plugin", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"description": "ESLint plugin for html", | ||
@@ -42,5 +42,5 @@ "author": "yeonjuan", | ||
"devDependencies": { | ||
"@html-eslint/parser": "^0.9.0" | ||
"@html-eslint/parser": "^0.10.0" | ||
}, | ||
"gitHead": "de0392bdeaa65e976f584fd86e60a8589316b018" | ||
"gitHead": "27a9558d936c67cb9e11df1b40a84d7b96bbbb43" | ||
} |
53235
42
1892