@html-eslint/eslint-plugin 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +24 -3
- package/lib/rules/element-newline.js +10 -3
- package/lib/rules/id-naming-convention.js +8 -1
- package/lib/rules/indent.js +6 -2
- package/lib/rules/lowercase.js +8 -1
- package/lib/rules/no-abstract-roles.js +8 -1
- package/lib/rules/no-accesskey-attrs.js +8 -1
- package/lib/rules/no-aria-hidden-body.js +5 -1
- package/lib/rules/no-duplicate-attrs.js +8 -1
- package/lib/rules/no-duplicate-id.js +8 -1
- package/lib/rules/no-extra-spacing-attrs.js +16 -1
- package/lib/rules/no-inline-styles.js +5 -1
- package/lib/rules/no-multiple-empty-lines.js +6 -1
- package/lib/rules/no-multiple-h1.js +6 -1
- package/lib/rules/no-non-scalable-viewport.js +5 -1
- package/lib/rules/no-obsolete-tags.js +5 -1
- package/lib/rules/no-positive-tabindex.js +8 -1
- package/lib/rules/no-restricted-attr-values.js +6 -1
- package/lib/rules/no-restricted-attrs.js +6 -1
- package/lib/rules/no-script-style-type.js +8 -1
- package/lib/rules/no-skip-heading-levels.js +6 -1
- package/lib/rules/no-target-blank.js +5 -1
- package/lib/rules/no-trailing-spaces.js +5 -1
- package/lib/rules/quotes.js +10 -1
- package/lib/rules/require-attrs.js +8 -1
- package/lib/rules/require-button-type.js +5 -1
- package/lib/rules/require-closing-tags.js +6 -1
- package/lib/rules/require-doctype.js +5 -1
- package/lib/rules/require-frame-title.js +5 -1
- package/lib/rules/require-img-alt.js +6 -1
- package/lib/rules/require-lang.js +5 -1
- package/lib/rules/require-li-container.js +5 -1
- package/lib/rules/require-meta-charset.js +7 -2
- package/lib/rules/require-meta-description.js +6 -2
- package/lib/rules/require-meta-viewport.js +7 -2
- package/lib/rules/require-open-graph-protocol.js +7 -2
- package/lib/rules/require-title.js +9 -3
- package/lib/rules/sort-attrs.js +8 -1
- package/lib/rules/utils/node.js +13 -0
- package/lib/types.d.ts +261 -262
- package/package.json +11 -7
- package/types/index.d.ts +14 -0
- package/types/index.d.ts.map +1 -0
package/lib/index.js
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
const rules = require("./rules");
|
|
2
2
|
const recommended = require("./configs/recommended");
|
|
3
|
+
const parser = require("@html-eslint/parser");
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @type {{configs: {recommended: typeof recommended,"flat/recommended": import("eslint").Linter.FlatConfig , rules: typeof rules}}}
|
|
7
|
+
*/
|
|
8
|
+
const plugin = {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
configs: {
|
|
11
|
+
recommended,
|
|
12
|
+
},
|
|
13
|
+
rules,
|
|
7
14
|
};
|
|
15
|
+
|
|
16
|
+
Object.assign(plugin.configs, {
|
|
17
|
+
"flat/recommended": {
|
|
18
|
+
plugins: {
|
|
19
|
+
"@html-eslint": plugin,
|
|
20
|
+
},
|
|
21
|
+
languageOptions: {
|
|
22
|
+
parser,
|
|
23
|
+
},
|
|
24
|
+
rules: recommended.rules,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
module.exports = plugin;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").ProgramNode } ProgramNode
|
|
4
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
5
|
+
* @typedef { import("../types").BaseNode } BaseNode
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
9
|
|
|
3
10
|
const MESSAGE_IDS = {
|
|
@@ -6,7 +13,7 @@ const MESSAGE_IDS = {
|
|
|
6
13
|
};
|
|
7
14
|
|
|
8
15
|
/**
|
|
9
|
-
* @type {
|
|
16
|
+
* @type {RuleModule}
|
|
10
17
|
*/
|
|
11
18
|
module.exports = {
|
|
12
19
|
meta: {
|
|
@@ -45,7 +52,7 @@ module.exports = {
|
|
|
45
52
|
const skipTags = option.skip;
|
|
46
53
|
let skipTagCount = 0;
|
|
47
54
|
/**
|
|
48
|
-
* @param {ChildType<TagNode | ProgramNode>[]} siblings
|
|
55
|
+
* @param {import("../types").ChildType<TagNode | ProgramNode>[]} siblings
|
|
49
56
|
*/
|
|
50
57
|
function checkSiblings(siblings) {
|
|
51
58
|
siblings
|
|
@@ -70,7 +77,7 @@ module.exports = {
|
|
|
70
77
|
|
|
71
78
|
/**
|
|
72
79
|
* @param {TagNode} node
|
|
73
|
-
* @param {ChildType<TagNode>[]} children
|
|
80
|
+
* @param {import("../types").ChildType<TagNode>[]} children
|
|
74
81
|
*/
|
|
75
82
|
function checkChild(node, children) {
|
|
76
83
|
const targetChildren = children.filter((n) => n.type !== "Text");
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
4
|
+
* @typedef { import("../types").ScriptTagNode } ScriptTagNode
|
|
5
|
+
* @typedef { import("../types").StyleTagNode } StyleTagNode
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
9
|
const {
|
|
3
10
|
isCamelCase,
|
|
@@ -27,7 +34,7 @@ const CONVENTION_CHECKERS = {
|
|
|
27
34
|
};
|
|
28
35
|
|
|
29
36
|
/**
|
|
30
|
-
* @type {
|
|
37
|
+
* @type {RuleModule}
|
|
31
38
|
*/
|
|
32
39
|
module.exports = {
|
|
33
40
|
meta: {
|
package/lib/rules/indent.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").AnyNode } AnyNode
|
|
4
|
+
* @typedef { import("../types").LineNode } LineNode
|
|
5
|
+
* @typedef { import("../types").BaseNode } BaseNode
|
|
6
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
2
7
|
* @typedef {Object} IndentType
|
|
3
8
|
* @property {"tab"} TAB
|
|
4
9
|
* @property {"space"} SPACE
|
|
5
|
-
*
|
|
6
10
|
* @typedef {Object} MessageId
|
|
7
11
|
* @property {"wrongIndent"} WRONG_INDENT
|
|
8
12
|
*/
|
|
@@ -24,7 +28,7 @@ const INDENT_TYPES = {
|
|
|
24
28
|
const IGNORING_NODES = ["pre", "xmp"];
|
|
25
29
|
|
|
26
30
|
/**
|
|
27
|
-
* @type {
|
|
31
|
+
* @type {RuleModule}
|
|
28
32
|
*/
|
|
29
33
|
module.exports = {
|
|
30
34
|
meta: {
|
package/lib/rules/lowercase.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
4
|
+
* @typedef { import("../types").StyleTagNode } StyleTagNode
|
|
5
|
+
* @typedef { import("../types").ScriptTagNode } ScriptTagNode
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
const { NODE_TYPES } = require("@html-eslint/parser");
|
|
2
9
|
const { RULE_CATEGORY } = require("../constants");
|
|
3
10
|
|
|
@@ -6,7 +13,7 @@ const MESSAGE_IDS = {
|
|
|
6
13
|
};
|
|
7
14
|
|
|
8
15
|
/**
|
|
9
|
-
* @type {
|
|
16
|
+
* @type {RuleModule}
|
|
10
17
|
*/
|
|
11
18
|
module.exports = {
|
|
12
19
|
meta: {
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
4
|
+
* @typedef { import("../types").StyleTagNode } StyleTagNode
|
|
5
|
+
* @typedef { import("../types").ScriptTagNode } ScriptTagNode
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
9
|
const { findAttr } = require("./utils/node");
|
|
3
10
|
|
|
@@ -21,7 +28,7 @@ const ABSTRACT_ROLE_SET = new Set([
|
|
|
21
28
|
]);
|
|
22
29
|
|
|
23
30
|
/**
|
|
24
|
-
* @type {
|
|
31
|
+
* @type {RuleModule}
|
|
25
32
|
*/
|
|
26
33
|
module.exports = {
|
|
27
34
|
meta: {
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
4
|
+
* @typedef { import("../types").StyleTagNode } StyleTagNode
|
|
5
|
+
* @typedef { import("../types").ScriptTagNode } ScriptTagNode
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
9
|
const { findAttr } = require("./utils/node");
|
|
3
10
|
|
|
@@ -6,7 +13,7 @@ const MESSAGE_IDS = {
|
|
|
6
13
|
};
|
|
7
14
|
|
|
8
15
|
/**
|
|
9
|
-
* @type {
|
|
16
|
+
* @type {RuleModule}
|
|
10
17
|
*/
|
|
11
18
|
module.exports = {
|
|
12
19
|
meta: {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
6
|
const { findAttr } = require("./utils/node");
|
|
3
7
|
|
|
@@ -6,7 +10,7 @@ const MESSAGE_IDS = {
|
|
|
6
10
|
};
|
|
7
11
|
|
|
8
12
|
/**
|
|
9
|
-
* @type {
|
|
13
|
+
* @type {RuleModule}
|
|
10
14
|
*/
|
|
11
15
|
module.exports = {
|
|
12
16
|
meta: {
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
4
|
+
* @typedef { import("../types").StyleTagNode } StyleTagNode
|
|
5
|
+
* @typedef { import("../types").ScriptTagNode } ScriptTagNode
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
9
|
|
|
3
10
|
const MESSAGE_IDS = {
|
|
@@ -5,7 +12,7 @@ const MESSAGE_IDS = {
|
|
|
5
12
|
};
|
|
6
13
|
|
|
7
14
|
/**
|
|
8
|
-
* @type {
|
|
15
|
+
* @type {RuleModule}
|
|
9
16
|
*/
|
|
10
17
|
module.exports = {
|
|
11
18
|
meta: {
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
4
|
+
* @typedef { import("../types").StyleTagNode } StyleTagNode
|
|
5
|
+
* @typedef { import("../types").ScriptTagNode } ScriptTagNode
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
9
|
const { findAttr } = require("./utils/node");
|
|
3
10
|
|
|
@@ -6,7 +13,7 @@ const MESSAGE_IDS = {
|
|
|
6
13
|
};
|
|
7
14
|
|
|
8
15
|
/**
|
|
9
|
-
* @type {
|
|
16
|
+
* @type {RuleModule}
|
|
10
17
|
*/
|
|
11
18
|
module.exports = {
|
|
12
19
|
meta: {
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").AttributeNode } AttributeNode
|
|
4
|
+
* @typedef { import("../types").OpenTagEndNode } OpenTagEndNode
|
|
5
|
+
* @typedef { import("../types").OpenScriptTagEndNode } OpenScriptTagEndNode
|
|
6
|
+
* @typedef { import("../types").OpenStyleTagEndNode } OpenStyleTagEndNode
|
|
7
|
+
* @typedef { import("../types").OpenScriptTagStartNode } OpenScriptTagStartNode
|
|
8
|
+
* @typedef { import("../types").OpenTagStartNode } OpenTagStartNode
|
|
9
|
+
* @typedef { import("../types").OpenStyleTagStartNode } OpenStyleTagStartNode
|
|
10
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
11
|
+
* @typedef { import("../types").StyleTagNode } StyleTagNode
|
|
12
|
+
* @typedef { import("../types").ScriptTagNode } ScriptTagNode
|
|
13
|
+
* @typedef { import("../types").AnyNode } AnyNode
|
|
14
|
+
*/
|
|
15
|
+
|
|
1
16
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
17
|
const { getLocBetween } = require("./utils/node");
|
|
3
18
|
|
|
@@ -11,7 +26,7 @@ const MESSAGE_IDS = {
|
|
|
11
26
|
};
|
|
12
27
|
|
|
13
28
|
/**
|
|
14
|
-
* @type {
|
|
29
|
+
* @type {RuleModule}
|
|
15
30
|
*/
|
|
16
31
|
module.exports = {
|
|
17
32
|
meta: {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
6
|
const { findAttr } = require("./utils/node");
|
|
3
7
|
|
|
@@ -6,7 +10,7 @@ const MESSAGE_IDS = {
|
|
|
6
10
|
};
|
|
7
11
|
|
|
8
12
|
/**
|
|
9
|
-
* @type {
|
|
13
|
+
* @type {RuleModule}
|
|
10
14
|
*/
|
|
11
15
|
module.exports = {
|
|
12
16
|
meta: {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").ProgramNode } ProgramNode
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
7
|
|
|
3
8
|
const MESSAGE_IDS = {
|
|
@@ -5,7 +10,7 @@ const MESSAGE_IDS = {
|
|
|
5
10
|
};
|
|
6
11
|
|
|
7
12
|
/**
|
|
8
|
-
* @type {
|
|
13
|
+
* @type {RuleModule}
|
|
9
14
|
*/
|
|
10
15
|
module.exports = {
|
|
11
16
|
meta: {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
7
|
|
|
3
8
|
const MESSAGE_IDS = {
|
|
@@ -5,7 +10,7 @@ const MESSAGE_IDS = {
|
|
|
5
10
|
};
|
|
6
11
|
|
|
7
12
|
/**
|
|
8
|
-
* @type {
|
|
13
|
+
* @type {RuleModule}
|
|
9
14
|
*/
|
|
10
15
|
module.exports = {
|
|
11
16
|
meta: {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
6
|
const { findAttr } = require("./utils/node");
|
|
3
7
|
|
|
@@ -6,7 +10,7 @@ const MESSAGE_IDS = {
|
|
|
6
10
|
};
|
|
7
11
|
|
|
8
12
|
/**
|
|
9
|
-
* @type {
|
|
13
|
+
* @type {RuleModule}
|
|
10
14
|
*/
|
|
11
15
|
module.exports = {
|
|
12
16
|
meta: {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
const { RULE_CATEGORY, OBSOLETE_TAGS } = require("../constants");
|
|
2
6
|
|
|
3
7
|
const OBSOLETE_TAGS_SET = new Set(OBSOLETE_TAGS);
|
|
@@ -7,7 +11,7 @@ const MESSAGE_IDS = {
|
|
|
7
11
|
};
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
|
-
* @type {
|
|
14
|
+
* @type {RuleModule}
|
|
11
15
|
*/
|
|
12
16
|
module.exports = {
|
|
13
17
|
meta: {
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
4
|
+
* @typedef { import("../types").StyleTagNode } StyleTagNode
|
|
5
|
+
* @typedef { import("../types").ScriptTagNode } ScriptTagNode
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
9
|
const { findAttr } = require("./utils/node");
|
|
3
10
|
|
|
@@ -6,7 +13,7 @@ const MESSAGE_IDS = {
|
|
|
6
13
|
};
|
|
7
14
|
|
|
8
15
|
/**
|
|
9
|
-
* @type {
|
|
16
|
+
* @type {RuleModule}
|
|
10
17
|
*/
|
|
11
18
|
module.exports = {
|
|
12
19
|
meta: {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").StyleTagNode } StyleTagNode
|
|
4
|
+
* @typedef { import("../types").AttributeNode } AttributeNode
|
|
5
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
6
|
+
* @typedef { import("../types").ScriptTagNode } ScriptTagNode
|
|
2
7
|
* @typedef {{attrPatterns: string[], attrValuePatterns: string[], message?: string}[]} Options
|
|
3
8
|
*/
|
|
4
9
|
|
|
@@ -9,7 +14,7 @@ const MESSAGE_IDS = {
|
|
|
9
14
|
};
|
|
10
15
|
|
|
11
16
|
/**
|
|
12
|
-
* @type {
|
|
17
|
+
* @type {RuleModule}
|
|
13
18
|
*/
|
|
14
19
|
module.exports = {
|
|
15
20
|
meta: {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").StyleTagNode } StyleTagNode
|
|
4
|
+
* @typedef { import("../types").AttributeNode } AttributeNode
|
|
5
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
6
|
+
* @typedef { import("../types").ScriptTagNode } ScriptTagNode
|
|
2
7
|
* @typedef {{tagPatterns: string[], attrPatterns: string[], message?: string}[]} Options
|
|
3
8
|
*/
|
|
4
9
|
|
|
@@ -10,7 +15,7 @@ const MESSAGE_IDS = {
|
|
|
10
15
|
};
|
|
11
16
|
|
|
12
17
|
/**
|
|
13
|
-
* @type {
|
|
18
|
+
* @type {RuleModule}
|
|
14
19
|
*/
|
|
15
20
|
module.exports = {
|
|
16
21
|
meta: {
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").StyleTagNode } StyleTagNode
|
|
4
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
5
|
+
* @typedef { import("../types").ScriptTagNode } ScriptTagNode
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
9
|
const { findAttr } = require("./utils/node");
|
|
3
10
|
|
|
@@ -6,7 +13,7 @@ const MESSAGE_IDS = {
|
|
|
6
13
|
};
|
|
7
14
|
|
|
8
15
|
/**
|
|
9
|
-
* @type {
|
|
16
|
+
* @type {RuleModule}
|
|
10
17
|
*/
|
|
11
18
|
module.exports = {
|
|
12
19
|
meta: {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
7
|
|
|
3
8
|
const MESSAGE_IDS = {
|
|
@@ -5,7 +10,7 @@ const MESSAGE_IDS = {
|
|
|
5
10
|
};
|
|
6
11
|
|
|
7
12
|
/**
|
|
8
|
-
* @type {
|
|
13
|
+
* @type {RuleModule}
|
|
9
14
|
*/
|
|
10
15
|
module.exports = {
|
|
11
16
|
meta: {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
6
|
const { findAttr } = require("./utils/node");
|
|
3
7
|
|
|
@@ -6,7 +10,7 @@ const MESSAGE_IDS = {
|
|
|
6
10
|
};
|
|
7
11
|
|
|
8
12
|
/**
|
|
9
|
-
* @type {
|
|
13
|
+
* @type {RuleModule}
|
|
10
14
|
*/
|
|
11
15
|
module.exports = {
|
|
12
16
|
meta: {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
6
|
|
|
3
7
|
const MESSAGE_IDS = {
|
|
@@ -5,7 +9,7 @@ const MESSAGE_IDS = {
|
|
|
5
9
|
};
|
|
6
10
|
|
|
7
11
|
/**
|
|
8
|
-
* @type {
|
|
12
|
+
* @type {RuleModule}
|
|
9
13
|
*/
|
|
10
14
|
module.exports = {
|
|
11
15
|
meta: {
|
package/lib/rules/quotes.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").Range } Range
|
|
4
|
+
* @typedef { import("../types").AttributeNode } AttributeNode
|
|
5
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
6
|
+
* @typedef { import("../types").ScriptTagNode } ScriptTagNode
|
|
7
|
+
* @typedef { import("../types").StyleTagNode } StyleTagNode
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
11
|
|
|
3
12
|
const MESSAGE_IDS = {
|
|
@@ -13,7 +22,7 @@ const QUOTES_STYLES = {
|
|
|
13
22
|
const QUOTES_CODES = [`"`, `'`];
|
|
14
23
|
|
|
15
24
|
/**
|
|
16
|
-
* @type {
|
|
25
|
+
* @type {RuleModule}
|
|
17
26
|
*/
|
|
18
27
|
module.exports = {
|
|
19
28
|
meta: {
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
4
|
+
* @typedef { import("../types").ScriptTagNode } ScriptTagNode
|
|
5
|
+
* @typedef { import("../types").StyleTagNode } StyleTagNode
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
const { NODE_TYPES } = require("@html-eslint/parser");
|
|
2
9
|
const { RULE_CATEGORY } = require("../constants");
|
|
3
10
|
|
|
@@ -7,7 +14,7 @@ const MESSAGE_IDS = {
|
|
|
7
14
|
};
|
|
8
15
|
|
|
9
16
|
/**
|
|
10
|
-
* @type {
|
|
17
|
+
* @type {RuleModule}
|
|
11
18
|
*/
|
|
12
19
|
module.exports = {
|
|
13
20
|
meta: {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
6
|
const { findAttr } = require("./utils/node");
|
|
3
7
|
|
|
@@ -9,7 +13,7 @@ const MESSAGE_IDS = {
|
|
|
9
13
|
const VALID_BUTTON_TYPES_SET = new Set(["submit", "button", "reset"]);
|
|
10
14
|
|
|
11
15
|
/**
|
|
12
|
-
* @type {
|
|
16
|
+
* @type {RuleModule}
|
|
13
17
|
*/
|
|
14
18
|
module.exports = {
|
|
15
19
|
meta: {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
const { RULE_CATEGORY, VOID_ELEMENTS } = require("../constants");
|
|
2
7
|
|
|
3
8
|
const VOID_ELEMENTS_SET = new Set(VOID_ELEMENTS);
|
|
@@ -9,7 +14,7 @@ const MESSAGE_IDS = {
|
|
|
9
14
|
};
|
|
10
15
|
|
|
11
16
|
/**
|
|
12
|
-
* @type {
|
|
17
|
+
* @type {RuleModule}
|
|
13
18
|
*/
|
|
14
19
|
module.exports = {
|
|
15
20
|
meta: {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
6
|
|
|
3
7
|
const MESSAGE_IDS = {
|
|
@@ -5,7 +9,7 @@ const MESSAGE_IDS = {
|
|
|
5
9
|
};
|
|
6
10
|
|
|
7
11
|
/**
|
|
8
|
-
* @type {
|
|
12
|
+
* @type {RuleModule}
|
|
9
13
|
*/
|
|
10
14
|
module.exports = {
|
|
11
15
|
meta: {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
6
|
const { findAttr } = require("./utils/node");
|
|
3
7
|
|
|
@@ -7,7 +11,7 @@ const MESSAGE_IDS = {
|
|
|
7
11
|
};
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
|
-
* @type {
|
|
14
|
+
* @type {RuleModule}
|
|
11
15
|
*/
|
|
12
16
|
module.exports = {
|
|
13
17
|
meta: {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
7
|
|
|
3
8
|
const MESSAGE_IDS = {
|
|
@@ -5,7 +10,7 @@ const MESSAGE_IDS = {
|
|
|
5
10
|
};
|
|
6
11
|
|
|
7
12
|
/**
|
|
8
|
-
* @type {
|
|
13
|
+
* @type {RuleModule}
|
|
9
14
|
*/
|
|
10
15
|
module.exports = {
|
|
11
16
|
meta: {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
const { RULE_CATEGORY } = require("../constants");
|
|
2
6
|
const { findAttr } = require("./utils/node");
|
|
3
7
|
|
|
@@ -7,7 +11,7 @@ const MESSAGE_IDS = {
|
|
|
7
11
|
};
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
|
-
* @type {
|
|
14
|
+
* @type {RuleModule}
|
|
11
15
|
*/
|
|
12
16
|
module.exports = {
|
|
13
17
|
meta: {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
const { NODE_TYPES } = require("@html-eslint/parser");
|
|
2
6
|
const { RULE_CATEGORY } = require("../constants");
|
|
3
7
|
|
|
@@ -8,7 +12,7 @@ const MESSAGE_IDS = {
|
|
|
8
12
|
const VALID_CONTAINERS = ["ul", "ol", "menu"];
|
|
9
13
|
|
|
10
14
|
/**
|
|
11
|
-
* @type {
|
|
15
|
+
* @type {RuleModule}
|
|
12
16
|
*/
|
|
13
17
|
module.exports = {
|
|
14
18
|
meta: {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
+
* @typedef { import("../types").TagNode } TagNode
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
const { NODE_TYPES } = require("@html-eslint/parser");
|
|
2
7
|
const { RULE_CATEGORY } = require("../constants");
|
|
3
8
|
const { find } = require("./utils/array");
|
|
@@ -9,7 +14,7 @@ const MESSAGE_IDS = {
|
|
|
9
14
|
};
|
|
10
15
|
|
|
11
16
|
/**
|
|
12
|
-
* @param {ChildType<TagNode>} node
|
|
17
|
+
* @param { import("../types").ChildType<TagNode>} node
|
|
13
18
|
* @returns {node is TagNode}
|
|
14
19
|
*/
|
|
15
20
|
function isMetaCharset(node) {
|
|
@@ -21,7 +26,7 @@ function isMetaCharset(node) {
|
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
/**
|
|
24
|
-
* @type {
|
|
29
|
+
* @type {RuleModule}
|
|
25
30
|
*/
|
|
26
31
|
module.exports = {
|
|
27
32
|
meta: {
|