@html-eslint/eslint-plugin 0.22.0 → 0.23.1
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/constants/svg-camel-case-attributes.js +73 -0
- 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 +51 -2
- 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/constants/svg-camel-case-attributes.d.ts +3 -0
- package/types/constants/svg-camel-case-attributes.d.ts.map +1 -0
- package/types/constants/svg-camelcase-attributes.d.ts +3 -0
- package/types/constants/svg-camelcase-attributes.d.ts.map +1 -0
- package/types/index.d.ts +14 -0
- package/types/index.d.ts.map +1 -0
- package/types/rules/lowercase.d.ts.map +1 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
module.exports = [
|
|
2
|
+
"allowReorder",
|
|
3
|
+
"attributeName",
|
|
4
|
+
"attributeType",
|
|
5
|
+
"autoReverse",
|
|
6
|
+
"baseFrequency",
|
|
7
|
+
"baseProfile",
|
|
8
|
+
"calcMode",
|
|
9
|
+
"clipPath",
|
|
10
|
+
"clipPathUnits",
|
|
11
|
+
"contentScriptType",
|
|
12
|
+
"contentStyleType",
|
|
13
|
+
"diffuseConstant",
|
|
14
|
+
"edgeMode",
|
|
15
|
+
"externalResourcesRequired",
|
|
16
|
+
"filterRes",
|
|
17
|
+
"filterUnits",
|
|
18
|
+
"glyphRef",
|
|
19
|
+
"gradientTransform",
|
|
20
|
+
"gradientUnits",
|
|
21
|
+
"kernelMatrix",
|
|
22
|
+
"kernelUnitLength",
|
|
23
|
+
"keyPoints",
|
|
24
|
+
"keySplines",
|
|
25
|
+
"keyTimes",
|
|
26
|
+
"lengthAdjust",
|
|
27
|
+
"limitingConeAngle",
|
|
28
|
+
"markerHeight",
|
|
29
|
+
"markerUnits",
|
|
30
|
+
"markerWidth",
|
|
31
|
+
"maskContentUnits",
|
|
32
|
+
"maskUnits",
|
|
33
|
+
"numOctaves",
|
|
34
|
+
"onBlur",
|
|
35
|
+
"onChange",
|
|
36
|
+
"onClick",
|
|
37
|
+
"onFocus",
|
|
38
|
+
"onKeyUp",
|
|
39
|
+
"onLoad",
|
|
40
|
+
"pathLength",
|
|
41
|
+
"patternContentUnits",
|
|
42
|
+
"patternTransform",
|
|
43
|
+
"patternUnits",
|
|
44
|
+
"pointsAtX",
|
|
45
|
+
"pointsAtY",
|
|
46
|
+
"pointsAtZ",
|
|
47
|
+
"preserveAlpha",
|
|
48
|
+
"preserveAspectRatio",
|
|
49
|
+
"primitiveUnits",
|
|
50
|
+
"refX",
|
|
51
|
+
"refY",
|
|
52
|
+
"repeatCount",
|
|
53
|
+
"repeatDur",
|
|
54
|
+
"requiredExtensions",
|
|
55
|
+
"requiredFeatures",
|
|
56
|
+
"specularConstant",
|
|
57
|
+
"specularExponent",
|
|
58
|
+
"spreadMethod",
|
|
59
|
+
"startOffset",
|
|
60
|
+
"stdDeviation",
|
|
61
|
+
"stitchTiles",
|
|
62
|
+
"surfaceScale",
|
|
63
|
+
"systemLanguage",
|
|
64
|
+
"tableValues",
|
|
65
|
+
"targetX",
|
|
66
|
+
"targetY",
|
|
67
|
+
"textLength",
|
|
68
|
+
"viewBox",
|
|
69
|
+
"viewTarget",
|
|
70
|
+
"xChannelSelector",
|
|
71
|
+
"yChannelSelector",
|
|
72
|
+
"zoomAndPan",
|
|
73
|
+
];
|
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,12 +1,20 @@
|
|
|
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");
|
|
10
|
+
const SVG_CAMEL_CASE_ATTRIBUTES = require("../constants/svg-camel-case-attributes");
|
|
3
11
|
|
|
4
12
|
const MESSAGE_IDS = {
|
|
5
13
|
UNEXPECTED: "unexpected",
|
|
6
14
|
};
|
|
7
15
|
|
|
8
16
|
/**
|
|
9
|
-
* @type {
|
|
17
|
+
* @type {RuleModule}
|
|
10
18
|
*/
|
|
11
19
|
module.exports = {
|
|
12
20
|
meta: {
|
|
@@ -26,6 +34,31 @@ module.exports = {
|
|
|
26
34
|
},
|
|
27
35
|
|
|
28
36
|
create(context) {
|
|
37
|
+
const allowedAttrKeySet = new Set(SVG_CAMEL_CASE_ATTRIBUTES);
|
|
38
|
+
/**
|
|
39
|
+
* @type {TagNode[]}
|
|
40
|
+
*/
|
|
41
|
+
const svgStack = [];
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @param {TagNode} node
|
|
45
|
+
*/
|
|
46
|
+
function enterSvg(node) {
|
|
47
|
+
svgStack.push(node);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function exitSvg() {
|
|
51
|
+
svgStack.pop();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @param {string} key
|
|
56
|
+
* @returns {boolean}
|
|
57
|
+
*/
|
|
58
|
+
function isAllowedAttributeKey(key) {
|
|
59
|
+
return !!svgStack.length && allowedAttrKeySet.has(key);
|
|
60
|
+
}
|
|
61
|
+
|
|
29
62
|
/**
|
|
30
63
|
* @param {TagNode | StyleTagNode | ScriptTagNode} node
|
|
31
64
|
*/
|
|
@@ -65,6 +98,9 @@ module.exports = {
|
|
|
65
98
|
}
|
|
66
99
|
if (node.attributes && node.attributes.length) {
|
|
67
100
|
node.attributes.forEach((attribute) => {
|
|
101
|
+
if (isAllowedAttributeKey(attribute.key.value)) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
68
104
|
if (attribute.key.value !== attribute.key.value.toLowerCase()) {
|
|
69
105
|
context.report({
|
|
70
106
|
node: attribute.key,
|
|
@@ -85,7 +121,20 @@ module.exports = {
|
|
|
85
121
|
}
|
|
86
122
|
|
|
87
123
|
return {
|
|
88
|
-
Tag
|
|
124
|
+
Tag(node) {
|
|
125
|
+
if (node.name.toLocaleLowerCase() === "svg") {
|
|
126
|
+
enterSvg(node);
|
|
127
|
+
}
|
|
128
|
+
check(node);
|
|
129
|
+
},
|
|
130
|
+
/**
|
|
131
|
+
* @param {TagNode} node
|
|
132
|
+
*/
|
|
133
|
+
"Tag:exit"(node) {
|
|
134
|
+
if (node.name.toLocaleLowerCase() === "svg") {
|
|
135
|
+
exitSvg();
|
|
136
|
+
}
|
|
137
|
+
},
|
|
89
138
|
StyleTag: check,
|
|
90
139
|
ScriptTag: check,
|
|
91
140
|
};
|
|
@@ -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: {
|