@html-eslint/eslint-plugin 0.39.0 → 0.40.0-alpha.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 +11 -2
- package/lib/languages/html-language.js +95 -0
- package/lib/languages/html-source-code.js +196 -0
- package/lib/languages/html-traversal-step.js +34 -0
- package/lib/rules/require-attrs.js +23 -3
- package/lib/rules/utils/baseline.js +58 -0
- package/lib/types/rule.ts +1 -1
- package/package.json +10 -7
- package/types/index.d.ts +5 -1
- package/types/index.d.ts.map +1 -1
- package/types/languages/html-language.d.ts +55 -0
- package/types/languages/html-language.d.ts.map +1 -0
- package/types/languages/html-source-code.d.ts +70 -0
- package/types/languages/html-source-code.d.ts.map +1 -0
- package/types/languages/html-traversal-step.d.ts +22 -0
- package/types/languages/html-traversal-step.d.ts.map +1 -0
- package/types/rules/require-attrs.d.ts +3 -1
- package/types/rules/require-attrs.d.ts.map +1 -1
- package/types/rules/utils/baseline.d.ts.map +1 -1
- package/types/types/rule.d.ts +1 -1
- package/types/types/rule.d.ts.map +1 -1
package/lib/index.js
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
const rules = require("./rules");
|
|
2
2
|
const recommended = require("./configs/recommended");
|
|
3
3
|
const parser = require("@html-eslint/parser");
|
|
4
|
-
|
|
4
|
+
const { HTMLLanguage } = require("./languages/html-language");
|
|
5
|
+
const { name, version } = require("../package.json");
|
|
5
6
|
/**
|
|
6
7
|
* @typedef {import("./rules")} AllRules
|
|
7
8
|
* @typedef {import("./configs/recommended")} RecommendedConfig
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
|
-
* @type {{rules: AllRules, configs: {recommended: RecommendedConfig, "flat/recommended": import("eslint").Linter.FlatConfig }}}
|
|
12
|
+
* @type {{meta: { name: string, version: string }, rules: AllRules, configs: {recommended: RecommendedConfig, "flat/recommended": import("eslint").Linter.FlatConfig }}}
|
|
12
13
|
*/
|
|
13
14
|
const plugin = {
|
|
15
|
+
meta: {
|
|
16
|
+
name,
|
|
17
|
+
version,
|
|
18
|
+
},
|
|
14
19
|
// @ts-ignore
|
|
15
20
|
configs: {
|
|
16
21
|
recommended,
|
|
17
22
|
},
|
|
23
|
+
languages: {
|
|
24
|
+
html: new HTMLLanguage(),
|
|
25
|
+
},
|
|
18
26
|
rules,
|
|
19
27
|
};
|
|
20
28
|
|
|
@@ -23,6 +31,7 @@ Object.assign(plugin.configs, {
|
|
|
23
31
|
plugins: {
|
|
24
32
|
"@html-eslint": plugin,
|
|
25
33
|
},
|
|
34
|
+
|
|
26
35
|
languageOptions: {
|
|
27
36
|
parser,
|
|
28
37
|
},
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
const { visitorKeys, parseForESLint } = require("@html-eslint/parser");
|
|
2
|
+
const { HTMLSourceCode } = require("./html-source-code");
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {import('@eslint/core').File} File
|
|
6
|
+
* @typedef {import('@html-eslint/parser').ParserOptions} LanguageOptions
|
|
7
|
+
*/
|
|
8
|
+
class HTMLLanguage {
|
|
9
|
+
constructor() {
|
|
10
|
+
/**
|
|
11
|
+
* @property
|
|
12
|
+
* @type {"text"}
|
|
13
|
+
*/
|
|
14
|
+
this.fileType = "text";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @property
|
|
18
|
+
* @type {0|1}
|
|
19
|
+
*/
|
|
20
|
+
this.lineStart = 1;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @property
|
|
24
|
+
* @type {0|1}
|
|
25
|
+
*/
|
|
26
|
+
this.columnStart = 0;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @type {string}
|
|
30
|
+
*/
|
|
31
|
+
this.nodeTypeKey = "type";
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The visitor keys for the CSSTree AST.
|
|
35
|
+
* @type {Record<string, string[]>}
|
|
36
|
+
*/
|
|
37
|
+
this.visitorKeys = visitorKeys;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @param {LanguageOptions} languageOptions
|
|
42
|
+
*/
|
|
43
|
+
validateLanguageOptions(languageOptions) {
|
|
44
|
+
if (!languageOptions) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (
|
|
48
|
+
"frontmatter" in languageOptions &&
|
|
49
|
+
typeof languageOptions.frontmatter !== "boolean"
|
|
50
|
+
) {
|
|
51
|
+
throw new TypeError("Expected a boolean value for 'frontmatter' option.");
|
|
52
|
+
}
|
|
53
|
+
if (
|
|
54
|
+
"templateEngineSyntax" in languageOptions &&
|
|
55
|
+
(typeof languageOptions.templateEngineSyntax !== "object" ||
|
|
56
|
+
!languageOptions.templateEngineSyntax)
|
|
57
|
+
) {
|
|
58
|
+
throw new TypeError(
|
|
59
|
+
"Expected an key-value record value for 'templateEngineSyntax' option."
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @param {File} file
|
|
66
|
+
* @param {Object} [context]
|
|
67
|
+
* @param {LanguageOptions} context.languageOptions
|
|
68
|
+
*/
|
|
69
|
+
parse(file, context) {
|
|
70
|
+
const code = /** @type {string} */ (file.body);
|
|
71
|
+
const languageOptions = (context && context.languageOptions) || {};
|
|
72
|
+
const result = parseForESLint(code, languageOptions);
|
|
73
|
+
return {
|
|
74
|
+
ok: true,
|
|
75
|
+
ast: result.ast,
|
|
76
|
+
comments: result.ast.comments,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @param {File} file
|
|
82
|
+
* @param {any} parseResult
|
|
83
|
+
*/
|
|
84
|
+
createSourceCode(file, parseResult) {
|
|
85
|
+
return new HTMLSourceCode({
|
|
86
|
+
text: /** @type {string} */ (file.body),
|
|
87
|
+
ast: parseResult.ast,
|
|
88
|
+
comments: parseResult.comments,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
module.exports = {
|
|
94
|
+
HTMLLanguage,
|
|
95
|
+
};
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import("eslint").AST.Program} Program
|
|
3
|
+
* @typedef {import("@eslint/plugin-kit").SourceLocation} SourceLocation
|
|
4
|
+
* @typedef {import("@eslint/plugin-kit").DirectiveType} DirectiveType
|
|
5
|
+
* @typedef {import("@eslint/core").TraversalStep} TraversalStep
|
|
6
|
+
* @typedef {import("@html-eslint/types").CommentContent} CommentContent
|
|
7
|
+
* @typedef {import("@html-eslint/types").AnyHTMLNode} AnyHTMLNode
|
|
8
|
+
* @typedef {import("../types").BaseNode} BaseNode
|
|
9
|
+
*/
|
|
10
|
+
const {
|
|
11
|
+
TextSourceCodeBase,
|
|
12
|
+
ConfigCommentParser,
|
|
13
|
+
Directive,
|
|
14
|
+
} = require("@eslint/plugin-kit");
|
|
15
|
+
const { SourceCode } = require("eslint");
|
|
16
|
+
const { HTMLTraversalStep, STEP_PHASE } = require("./html-traversal-step");
|
|
17
|
+
const { visitorKeys } = require("@html-eslint/parser");
|
|
18
|
+
|
|
19
|
+
const INLINE_CONFIG =
|
|
20
|
+
/^\s*(?:eslint(?:-enable|-disable(?:(?:-next)?-line)?)?)(?:\s|$)/u;
|
|
21
|
+
|
|
22
|
+
const commentParser = new ConfigCommentParser();
|
|
23
|
+
|
|
24
|
+
class HTMLSourceCode extends TextSourceCodeBase {
|
|
25
|
+
/**
|
|
26
|
+
* @param {{ast: Program, text: string, comments: CommentContent[]}} config
|
|
27
|
+
*/
|
|
28
|
+
constructor({ ast, text, comments }) {
|
|
29
|
+
super({ ast, text });
|
|
30
|
+
/**
|
|
31
|
+
* @property
|
|
32
|
+
*/
|
|
33
|
+
this.eslintSourceCode = new SourceCode(text, ast);
|
|
34
|
+
/**
|
|
35
|
+
* @property
|
|
36
|
+
*/
|
|
37
|
+
this.ast = ast;
|
|
38
|
+
/**
|
|
39
|
+
* @property
|
|
40
|
+
*/
|
|
41
|
+
this.comments = comments;
|
|
42
|
+
this.parentsMap = new Map();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @param {BaseNode} node
|
|
47
|
+
* @returns {[number, number]}
|
|
48
|
+
*/
|
|
49
|
+
getRange(node) {
|
|
50
|
+
return node.range;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @param {BaseNode} node
|
|
55
|
+
* @returns {import("@eslint/plugin-kit").SourceLocation}
|
|
56
|
+
*/
|
|
57
|
+
getLoc(node) {
|
|
58
|
+
return node.loc;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
getLines() {
|
|
62
|
+
return this.lines;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @param {import("@eslint/core").Position} loc
|
|
67
|
+
* @returns
|
|
68
|
+
*/
|
|
69
|
+
getIndexFromLoc(loc) {
|
|
70
|
+
return this.eslintSourceCode.getIndexFromLoc(loc);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @param {number} index
|
|
75
|
+
* @returns {import("@eslint/core").Position}
|
|
76
|
+
*/
|
|
77
|
+
getLocFromIndex(index) {
|
|
78
|
+
return this.eslintSourceCode.getLocFromIndex(index);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
getInlineConfigNodes() {
|
|
82
|
+
return this.comments.filter((comment) => INLINE_CONFIG.test(comment.value));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
getDisableDirectives() {
|
|
86
|
+
/**
|
|
87
|
+
* @type {{ruleId: null | string, message: string; loc: SourceLocation}[]}
|
|
88
|
+
*/
|
|
89
|
+
const problems = [];
|
|
90
|
+
/**
|
|
91
|
+
* @type {Directive[]}
|
|
92
|
+
*/
|
|
93
|
+
const directives = [];
|
|
94
|
+
|
|
95
|
+
this.getInlineConfigNodes().forEach((comment) => {
|
|
96
|
+
const parsed = commentParser.parseDirective(comment.value);
|
|
97
|
+
if (!parsed) return;
|
|
98
|
+
const { label, value, justification } = parsed;
|
|
99
|
+
// `eslint-disable-line` directives are not allowed to span multiple lines as it would be confusing to which lines they apply
|
|
100
|
+
if (
|
|
101
|
+
label === "eslint-disable-line" &&
|
|
102
|
+
comment.loc.start.line !== comment.loc.end.line
|
|
103
|
+
) {
|
|
104
|
+
const message = `${label} comment should not span multiple lines.`;
|
|
105
|
+
|
|
106
|
+
problems.push({
|
|
107
|
+
ruleId: null,
|
|
108
|
+
message,
|
|
109
|
+
loc: comment.loc,
|
|
110
|
+
});
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
switch (label) {
|
|
115
|
+
case "eslint-disable":
|
|
116
|
+
case "eslint-enable":
|
|
117
|
+
case "eslint-disable-next-line":
|
|
118
|
+
case "eslint-disable-line": {
|
|
119
|
+
const directiveType = label.slice("eslint-".length);
|
|
120
|
+
directives.push(
|
|
121
|
+
new Directive({
|
|
122
|
+
type: /** @type {DirectiveType} */ (directiveType),
|
|
123
|
+
node: comment,
|
|
124
|
+
value,
|
|
125
|
+
justification,
|
|
126
|
+
})
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
return { problems, directives };
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
traverse() {
|
|
136
|
+
/**
|
|
137
|
+
* @type {TraversalStep[]}
|
|
138
|
+
*/
|
|
139
|
+
const steps = [];
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
*
|
|
143
|
+
* @param {AnyHTMLNode | Program} node
|
|
144
|
+
* @param {AnyHTMLNode | Program | null} parent
|
|
145
|
+
*/
|
|
146
|
+
const visit = (node, parent) => {
|
|
147
|
+
this.parentsMap.set(node, parent);
|
|
148
|
+
// @ts-ignore
|
|
149
|
+
node.parent = parent;
|
|
150
|
+
steps.push(
|
|
151
|
+
new HTMLTraversalStep({
|
|
152
|
+
target: node,
|
|
153
|
+
phase: STEP_PHASE.ENTER,
|
|
154
|
+
args: [node, parent],
|
|
155
|
+
})
|
|
156
|
+
);
|
|
157
|
+
// @ts-ignore
|
|
158
|
+
for (const key of visitorKeys[node.type] || []) {
|
|
159
|
+
// @ts-ignore
|
|
160
|
+
const child = node[key];
|
|
161
|
+
|
|
162
|
+
if (child) {
|
|
163
|
+
if (Array.isArray(child)) {
|
|
164
|
+
child.forEach((grandchild) => {
|
|
165
|
+
visit(grandchild, node);
|
|
166
|
+
});
|
|
167
|
+
} else {
|
|
168
|
+
visit(child, node);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
steps.push(
|
|
173
|
+
new HTMLTraversalStep({
|
|
174
|
+
target: node,
|
|
175
|
+
phase: STEP_PHASE.EXIT,
|
|
176
|
+
args: [node, parent],
|
|
177
|
+
})
|
|
178
|
+
);
|
|
179
|
+
};
|
|
180
|
+
visit(this.ast, null);
|
|
181
|
+
|
|
182
|
+
return steps;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* @param {AnyHTMLNode} node
|
|
187
|
+
* @returns
|
|
188
|
+
*/
|
|
189
|
+
getParent(node) {
|
|
190
|
+
return this.parentsMap.get(node);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
module.exports = {
|
|
195
|
+
HTMLSourceCode,
|
|
196
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import("eslint").AST.Program} Program
|
|
3
|
+
* @typedef {import('@html-eslint/types').AnyHTMLNode} AnyHTMLNode
|
|
4
|
+
*/
|
|
5
|
+
const { VisitNodeStep } = require("@eslint/plugin-kit");
|
|
6
|
+
|
|
7
|
+
const STEP_PHASE = {
|
|
8
|
+
/**
|
|
9
|
+
* @type {1}
|
|
10
|
+
*/
|
|
11
|
+
ENTER: 1,
|
|
12
|
+
/**
|
|
13
|
+
* @type {2}
|
|
14
|
+
*/
|
|
15
|
+
EXIT: 2,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
class HTMLTraversalStep extends VisitNodeStep {
|
|
19
|
+
/**
|
|
20
|
+
* @param {Object} options
|
|
21
|
+
* @param {AnyHTMLNode | Program} options.target
|
|
22
|
+
* @param {1|2} options.phase
|
|
23
|
+
* @param {Array<any>} options.args
|
|
24
|
+
*/
|
|
25
|
+
constructor({ target, phase, args }) {
|
|
26
|
+
super({ target, phase, args });
|
|
27
|
+
this.target = target;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = {
|
|
32
|
+
HTMLTraversalStep,
|
|
33
|
+
STEP_PHASE,
|
|
34
|
+
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
3
3
|
* @typedef { import("@html-eslint/types").ScriptTag } ScriptTag
|
|
4
4
|
* @typedef { import("@html-eslint/types").StyleTag } StyleTag
|
|
5
|
+
* @typedef { import("@html-eslint/types").Attribute } Attribute
|
|
5
6
|
*
|
|
6
7
|
* @typedef {Object} Option
|
|
7
8
|
* @property {string} tag
|
|
@@ -9,6 +10,7 @@
|
|
|
9
10
|
* @property {string} [value]
|
|
10
11
|
*
|
|
11
12
|
* @typedef { import("../types").RuleModule<Option[]> } RuleModule
|
|
13
|
+
* @typedef { import("../types").ReportFixFunction} ReportFixFunction
|
|
12
14
|
*
|
|
13
15
|
*/
|
|
14
16
|
|
|
@@ -33,7 +35,7 @@ module.exports = {
|
|
|
33
35
|
category: RULE_CATEGORY.BEST_PRACTICE,
|
|
34
36
|
recommended: false,
|
|
35
37
|
},
|
|
36
|
-
fixable:
|
|
38
|
+
fixable: "code",
|
|
37
39
|
schema: {
|
|
38
40
|
type: "array",
|
|
39
41
|
items: {
|
|
@@ -48,9 +50,9 @@ module.exports = {
|
|
|
48
50
|
},
|
|
49
51
|
},
|
|
50
52
|
messages: {
|
|
51
|
-
[MESSAGE_IDS.MISSING]: "Missing '{{attr}}'
|
|
53
|
+
[MESSAGE_IDS.MISSING]: "Missing '{{attr}}' attribute on '{{tag}}' tag",
|
|
52
54
|
[MESSAGE_IDS.UNEXPECTED]:
|
|
53
|
-
"Unexpected '{{attr}}'
|
|
55
|
+
"Unexpected '{{attr}}' attribute value. '{{expected}}' is expected",
|
|
54
56
|
},
|
|
55
57
|
},
|
|
56
58
|
|
|
@@ -97,6 +99,15 @@ module.exports = {
|
|
|
97
99
|
attr: attrName,
|
|
98
100
|
tag: tagName,
|
|
99
101
|
},
|
|
102
|
+
fix(fixer) {
|
|
103
|
+
if (!option.value) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
return fixer.insertTextAfter(
|
|
107
|
+
node.openStart,
|
|
108
|
+
` ${attrName}="${option.value}"`
|
|
109
|
+
);
|
|
110
|
+
},
|
|
100
111
|
});
|
|
101
112
|
} else if (
|
|
102
113
|
typeof option.value === "string" &&
|
|
@@ -109,6 +120,15 @@ module.exports = {
|
|
|
109
120
|
attr: attrName,
|
|
110
121
|
expected: option.value,
|
|
111
122
|
},
|
|
123
|
+
fix(fixer) {
|
|
124
|
+
if (option.value) {
|
|
125
|
+
if (attr.value) {
|
|
126
|
+
return fixer.replaceText(attr.value, option.value);
|
|
127
|
+
}
|
|
128
|
+
return fixer.insertTextAfter(attr.key, `="${option.value}"`);
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
},
|
|
112
132
|
});
|
|
113
133
|
}
|
|
114
134
|
});
|
|
@@ -90,12 +90,23 @@ const elements = new Map([
|
|
|
90
90
|
["canvas.height", "10:2015"],
|
|
91
91
|
["canvas.width", "10:2015"],
|
|
92
92
|
["caption", "10:2015"],
|
|
93
|
+
["caption.align", "0:"],
|
|
93
94
|
["cite", "10:2015"],
|
|
94
95
|
["code", "10:2015"],
|
|
95
96
|
["col", "10:2015"],
|
|
97
|
+
["col.align", "0:"],
|
|
98
|
+
["col.char", "0:"],
|
|
99
|
+
["col.charoff", "0:"],
|
|
96
100
|
["col.span", "10:2015"],
|
|
101
|
+
["col.valign", "0:"],
|
|
102
|
+
["col.width", "0:"],
|
|
97
103
|
["colgroup", "10:2015"],
|
|
104
|
+
["colgroup.align", "0:"],
|
|
105
|
+
["colgroup.char", "0:"],
|
|
106
|
+
["colgroup.charoff", "0:"],
|
|
98
107
|
["colgroup.span", "10:2015"],
|
|
108
|
+
["colgroup.valign", "0:"],
|
|
109
|
+
["colgroup.width", "0:"],
|
|
99
110
|
["data", "10:2017"],
|
|
100
111
|
["data.value", "10:2017"],
|
|
101
112
|
["datalist", "0:"],
|
|
@@ -312,6 +323,7 @@ const elements = new Map([
|
|
|
312
323
|
["link.referrerpolicy.unsafe-url", "0:"],
|
|
313
324
|
["link.rel", "10:2015"],
|
|
314
325
|
["link.rel.alternate_stylesheet", "0:"],
|
|
326
|
+
["link.rel.compression-dictionary", "0:"],
|
|
315
327
|
["link.rel.dns-prefetch", "5:2024"],
|
|
316
328
|
["link.rel.expect", "0:"],
|
|
317
329
|
["link.rel.manifest", "0:"],
|
|
@@ -419,6 +431,7 @@ const elements = new Map([
|
|
|
419
431
|
"0:",
|
|
420
432
|
],
|
|
421
433
|
["script.type.speculationrules.source_optional", "0:"],
|
|
434
|
+
["script.type.speculationrules.tag", "0:"],
|
|
422
435
|
["script.type.speculationrules.urls", "0:"],
|
|
423
436
|
["script.type.speculationrules.where", "0:"],
|
|
424
437
|
["search", "5:2023"],
|
|
@@ -453,12 +466,35 @@ const elements = new Map([
|
|
|
453
466
|
["summary.display_list_item", "0:"],
|
|
454
467
|
["sup", "10:2015"],
|
|
455
468
|
["table", "10:2015"],
|
|
469
|
+
["table.align", "0:"],
|
|
470
|
+
["table.bgcolor", "0:"],
|
|
471
|
+
["table.border", "0:"],
|
|
472
|
+
["table.cellpadding", "0:"],
|
|
473
|
+
["table.cellspacing", "0:"],
|
|
474
|
+
["table.frame", "0:"],
|
|
475
|
+
["table.rules", "0:"],
|
|
476
|
+
["table.summary", "0:"],
|
|
477
|
+
["table.width", "0:"],
|
|
456
478
|
["tbody", "10:2015"],
|
|
479
|
+
["tbody.align", "0:"],
|
|
480
|
+
["tbody.bgcolor", "0:"],
|
|
481
|
+
["tbody.char", "0:"],
|
|
482
|
+
["tbody.charoff", "0:"],
|
|
483
|
+
["tbody.valign", "0:"],
|
|
457
484
|
["td", "10:2015"],
|
|
485
|
+
["td.abbr", "0:"],
|
|
486
|
+
["td.align", "0:"],
|
|
487
|
+
["td.axis", "0:"],
|
|
488
|
+
["td.bgcolor", "0:"],
|
|
489
|
+
["td.char", "0:"],
|
|
490
|
+
["td.charoff", "0:"],
|
|
458
491
|
["td.colspan", "10:2015"],
|
|
459
492
|
["td.headers", "10:2015"],
|
|
460
493
|
["td.rowspan", "10:2015"],
|
|
461
494
|
["td.rowspan.rowspan_zero", "0:"],
|
|
495
|
+
["td.scope", "0:"],
|
|
496
|
+
["td.valign", "0:"],
|
|
497
|
+
["td.width", "0:"],
|
|
462
498
|
["template", "10:2015"],
|
|
463
499
|
["template.shadowrootclonable", "0:"],
|
|
464
500
|
["template.shadowrootdelegatesfocus", "0:"],
|
|
@@ -482,18 +518,40 @@ const elements = new Map([
|
|
|
482
518
|
["textarea.wrap", "10:2015"],
|
|
483
519
|
["textarea.wrap.hard", "0:"],
|
|
484
520
|
["tfoot", "10:2015"],
|
|
521
|
+
["tfoot.align", "0:"],
|
|
522
|
+
["tfoot.bgcolor", "0:"],
|
|
523
|
+
["tfoot.char", "0:"],
|
|
524
|
+
["tfoot.charoff", "0:"],
|
|
525
|
+
["tfoot.valign", "0:"],
|
|
485
526
|
["th", "10:2015"],
|
|
486
527
|
["th.abbr", "10:2015"],
|
|
528
|
+
["th.align", "0:"],
|
|
529
|
+
["th.axis", "0:"],
|
|
530
|
+
["th.bgcolor", "0:"],
|
|
531
|
+
["th.char", "0:"],
|
|
532
|
+
["th.charoff", "0:"],
|
|
487
533
|
["th.colspan", "10:2015"],
|
|
488
534
|
["th.headers", "10:2015"],
|
|
489
535
|
["th.rowspan", "10:2015"],
|
|
490
536
|
["th.rowspan.rowspan_zero", "0:"],
|
|
491
537
|
["th.scope", "10:2015"],
|
|
538
|
+
["th.valign", "0:"],
|
|
539
|
+
["th.width", "0:"],
|
|
492
540
|
["thead", "10:2015"],
|
|
541
|
+
["thead.align", "0:"],
|
|
542
|
+
["thead.bgcolor", "0:"],
|
|
543
|
+
["thead.char", "0:"],
|
|
544
|
+
["thead.charoff", "0:"],
|
|
545
|
+
["thead.valign", "0:"],
|
|
493
546
|
["time", "10:2017"],
|
|
494
547
|
["time.datetime", "10:2017"],
|
|
495
548
|
["title", "10:2015"],
|
|
496
549
|
["tr", "10:2015"],
|
|
550
|
+
["tr.align", "0:"],
|
|
551
|
+
["tr.bgcolor", "0:"],
|
|
552
|
+
["tr.char", "0:"],
|
|
553
|
+
["tr.charoff", "0:"],
|
|
554
|
+
["tr.valign", "0:"],
|
|
497
555
|
["track", "10:2015"],
|
|
498
556
|
["track.default", "10:2015"],
|
|
499
557
|
["track.kind", "10:2015"],
|
package/lib/types/rule.ts
CHANGED
|
@@ -71,7 +71,7 @@ export interface RuleFixer {
|
|
|
71
71
|
replaceTextRange(range: eslint.AST.Range, text: string): RuleFix;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
type ReportFixFunction = (
|
|
74
|
+
export type ReportFixFunction = (
|
|
75
75
|
fixer: RuleFixer
|
|
76
76
|
) => IterableIterator<RuleFix> | readonly RuleFix[] | RuleFix | null;
|
|
77
77
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@html-eslint/eslint-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0-alpha.0",
|
|
4
4
|
"description": "ESLint plugin for html",
|
|
5
5
|
"author": "yeonjuan",
|
|
6
6
|
"homepage": "https://github.com/yeonjuan/html-eslint#readme",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"test": "jest --coverage",
|
|
23
|
+
"test:legacy": "TEST_ESLINT_LEGACY_CONFIG=true && jest",
|
|
23
24
|
"ts": "tsc --noEmit",
|
|
24
25
|
"lint": "eslint .",
|
|
25
26
|
"build": "rimraf types && tsc --project tsconfig.build.json"
|
|
@@ -37,18 +38,20 @@
|
|
|
37
38
|
"accessibility"
|
|
38
39
|
],
|
|
39
40
|
"dependencies": {
|
|
40
|
-
"@
|
|
41
|
-
"@html-eslint/template-
|
|
41
|
+
"@eslint/plugin-kit": "0.2.8",
|
|
42
|
+
"@html-eslint/template-parser": "^0.40.0-alpha.0",
|
|
43
|
+
"@html-eslint/template-syntax-parser": "^0.40.0-alpha.0"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
44
|
-
"@
|
|
45
|
-
"@html-eslint/
|
|
46
|
+
"@eslint/core": "0.13.0",
|
|
47
|
+
"@html-eslint/parser": "^0.40.0-alpha.0",
|
|
48
|
+
"@html-eslint/types": "^0.40.0-alpha.0",
|
|
46
49
|
"@types/eslint": "^9.6.1",
|
|
47
50
|
"@types/estree": "^0.0.47",
|
|
48
|
-
"es-html-parser": "0.
|
|
51
|
+
"es-html-parser": "0.2.0",
|
|
49
52
|
"eslint": "^9.21.0",
|
|
50
53
|
"espree": "^10.3.0",
|
|
51
54
|
"typescript": "^5.7.2"
|
|
52
55
|
},
|
|
53
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "f62545e1268c688f79026b078fcdc013aa4a462d"
|
|
54
57
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -4,9 +4,13 @@ export = plugin;
|
|
|
4
4
|
* @typedef {import("./configs/recommended")} RecommendedConfig
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* @type {{rules: AllRules, configs: {recommended: RecommendedConfig, "flat/recommended": import("eslint").Linter.FlatConfig }}}
|
|
7
|
+
* @type {{meta: { name: string, version: string }, rules: AllRules, configs: {recommended: RecommendedConfig, "flat/recommended": import("eslint").Linter.FlatConfig }}}
|
|
8
8
|
*/
|
|
9
9
|
declare const plugin: {
|
|
10
|
+
meta: {
|
|
11
|
+
name: string;
|
|
12
|
+
version: string;
|
|
13
|
+
};
|
|
10
14
|
rules: AllRules;
|
|
11
15
|
configs: {
|
|
12
16
|
recommended: RecommendedConfig;
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.js"],"names":[],"mappings":";AAKA;;;GAGG;AAEH;;GAEG;AACH,sBAFU;IAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE;QAAC,WAAW,EAAE,iBAAiB,CAAC;QAAC,kBAAkB,EAAE,OAAO,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAA;KAAE,CAAA;CAAC,CAetK"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export type File = import("@eslint/core").File;
|
|
2
|
+
export type LanguageOptions = import("@html-eslint/parser").ParserOptions;
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {import('@eslint/core').File} File
|
|
5
|
+
* @typedef {import('@html-eslint/parser').ParserOptions} LanguageOptions
|
|
6
|
+
*/
|
|
7
|
+
export class HTMLLanguage {
|
|
8
|
+
/**
|
|
9
|
+
* @property
|
|
10
|
+
* @type {"text"}
|
|
11
|
+
*/
|
|
12
|
+
fileType: "text";
|
|
13
|
+
/**
|
|
14
|
+
* @property
|
|
15
|
+
* @type {0|1}
|
|
16
|
+
*/
|
|
17
|
+
lineStart: 0 | 1;
|
|
18
|
+
/**
|
|
19
|
+
* @property
|
|
20
|
+
* @type {0|1}
|
|
21
|
+
*/
|
|
22
|
+
columnStart: 0 | 1;
|
|
23
|
+
/**
|
|
24
|
+
* @type {string}
|
|
25
|
+
*/
|
|
26
|
+
nodeTypeKey: string;
|
|
27
|
+
/**
|
|
28
|
+
* The visitor keys for the CSSTree AST.
|
|
29
|
+
* @type {Record<string, string[]>}
|
|
30
|
+
*/
|
|
31
|
+
visitorKeys: Record<string, string[]>;
|
|
32
|
+
/**
|
|
33
|
+
* @param {LanguageOptions} languageOptions
|
|
34
|
+
*/
|
|
35
|
+
validateLanguageOptions(languageOptions: LanguageOptions): void;
|
|
36
|
+
/**
|
|
37
|
+
* @param {File} file
|
|
38
|
+
* @param {Object} [context]
|
|
39
|
+
* @param {LanguageOptions} context.languageOptions
|
|
40
|
+
*/
|
|
41
|
+
parse(file: File, context?: {
|
|
42
|
+
languageOptions: LanguageOptions;
|
|
43
|
+
}): {
|
|
44
|
+
ok: boolean;
|
|
45
|
+
ast: any;
|
|
46
|
+
comments: any;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* @param {File} file
|
|
50
|
+
* @param {any} parseResult
|
|
51
|
+
*/
|
|
52
|
+
createSourceCode(file: File, parseResult: any): HTMLSourceCode;
|
|
53
|
+
}
|
|
54
|
+
import { HTMLSourceCode } from "./html-source-code";
|
|
55
|
+
//# sourceMappingURL=html-language.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-language.d.ts","sourceRoot":"","sources":["../../lib/languages/html-language.js"],"names":[],"mappings":"mBAIa,OAAO,cAAc,EAAE,IAAI;8BAC3B,OAAO,qBAAqB,EAAE,aAAa;AAFxD;;;GAGG;AACH;IAEI;;;OAGG;IACH,UAFU,MAAM,CAEM;IAEtB;;;OAGG;IACH,WAFU,CAAC,GAAC,CAAC,CAEK;IAElB;;;OAGG;IACH,aAFU,CAAC,GAAC,CAAC,CAEO;IAEpB;;OAEG;IACH,aAFU,MAAM,CAES;IAEzB;;;OAGG;IACH,aAFU,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAEJ;IAGhC;;OAEG;IACH,yCAFW,eAAe,QAqBzB;IAED;;;;OAIG;IACH,YAJW,IAAI,YAEZ;QAAiC,eAAe,EAAxC,eAAe;KACzB;;;;MAUA;IAED;;;OAGG;IACH,uBAHW,IAAI,eACJ,GAAG,kBAQb;CACF"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export type Program = import("eslint").AST.Program;
|
|
2
|
+
export type SourceLocation = import("@eslint/plugin-kit").SourceLocation;
|
|
3
|
+
export type DirectiveType = import("@eslint/plugin-kit").DirectiveType;
|
|
4
|
+
export type TraversalStep = import("@eslint/core").TraversalStep;
|
|
5
|
+
export type CommentContent = import("@html-eslint/types").CommentContent;
|
|
6
|
+
export type AnyHTMLNode = import("@html-eslint/types").AnyHTMLNode;
|
|
7
|
+
export type BaseNode = import("../types").BaseNode;
|
|
8
|
+
export class HTMLSourceCode extends TextSourceCodeBase {
|
|
9
|
+
/**
|
|
10
|
+
* @param {{ast: Program, text: string, comments: CommentContent[]}} config
|
|
11
|
+
*/
|
|
12
|
+
constructor({ ast, text, comments }: {
|
|
13
|
+
ast: Program;
|
|
14
|
+
text: string;
|
|
15
|
+
comments: CommentContent[];
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* @property
|
|
19
|
+
*/
|
|
20
|
+
eslintSourceCode: SourceCode;
|
|
21
|
+
/**
|
|
22
|
+
* @property
|
|
23
|
+
*/
|
|
24
|
+
ast: import("eslint").AST.Program;
|
|
25
|
+
/**
|
|
26
|
+
* @property
|
|
27
|
+
*/
|
|
28
|
+
comments: import("@html-eslint/types").CommentContent[];
|
|
29
|
+
parentsMap: Map<any, any>;
|
|
30
|
+
/**
|
|
31
|
+
* @param {BaseNode} node
|
|
32
|
+
* @returns {[number, number]}
|
|
33
|
+
*/
|
|
34
|
+
getRange(node: BaseNode): [number, number];
|
|
35
|
+
/**
|
|
36
|
+
* @param {BaseNode} node
|
|
37
|
+
* @returns {import("@eslint/plugin-kit").SourceLocation}
|
|
38
|
+
*/
|
|
39
|
+
getLoc(node: BaseNode): import("@eslint/plugin-kit").SourceLocation;
|
|
40
|
+
getLines(): string[];
|
|
41
|
+
/**
|
|
42
|
+
* @param {import("@eslint/core").Position} loc
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
getIndexFromLoc(loc: import("@eslint/core").Position): number;
|
|
46
|
+
/**
|
|
47
|
+
* @param {number} index
|
|
48
|
+
* @returns {import("@eslint/core").Position}
|
|
49
|
+
*/
|
|
50
|
+
getLocFromIndex(index: number): import("@eslint/core").Position;
|
|
51
|
+
getInlineConfigNodes(): import("@html-eslint/types").CommentContent[];
|
|
52
|
+
getDisableDirectives(): {
|
|
53
|
+
problems: {
|
|
54
|
+
ruleId: null | string;
|
|
55
|
+
message: string;
|
|
56
|
+
loc: SourceLocation;
|
|
57
|
+
}[];
|
|
58
|
+
directives: Directive[];
|
|
59
|
+
};
|
|
60
|
+
traverse(): import("@eslint/core").TraversalStep[];
|
|
61
|
+
/**
|
|
62
|
+
* @param {AnyHTMLNode} node
|
|
63
|
+
* @returns
|
|
64
|
+
*/
|
|
65
|
+
getParent(node: AnyHTMLNode): any;
|
|
66
|
+
}
|
|
67
|
+
import { TextSourceCodeBase } from "@eslint/plugin-kit";
|
|
68
|
+
import { SourceCode } from "eslint";
|
|
69
|
+
import { Directive } from "@eslint/plugin-kit";
|
|
70
|
+
//# sourceMappingURL=html-source-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-source-code.d.ts","sourceRoot":"","sources":["../../lib/languages/html-source-code.js"],"names":[],"mappings":"sBACc,OAAO,QAAQ,EAAE,GAAG,CAAC,OAAO;6BAC5B,OAAO,oBAAoB,EAAE,cAAc;4BAC3C,OAAO,oBAAoB,EAAE,aAAa;4BAC1C,OAAO,cAAc,EAAE,aAAa;6BACpC,OAAO,oBAAoB,EAAE,cAAc;0BAC3C,OAAO,oBAAoB,EAAE,WAAW;uBACxC,OAAO,UAAU,EAAE,QAAQ;AAgBzC;IACE;;OAEG;IACH,qCAFW;QAAC,GAAG,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,cAAc,EAAE,CAAA;KAAC,EAiBlE;IAbC;;OAEG;IACH,6BAAiD;IACjD;;OAEG;IACH,kCAAc;IACd;;OAEG;IACH,wDAAwB;IACxB,0BAA2B;IAG7B;;;OAGG;IACH,eAHW,QAAQ,GACN,CAAC,MAAM,EAAE,MAAM,CAAC,CAI5B;IAED;;;OAGG;IACH,aAHW,QAAQ,GACN,OAAO,oBAAoB,EAAE,cAAc,CAIvD;IAED,qBAEC;IAED;;;OAGG;IACH,qBAHW,OAAO,cAAc,EAAE,QAAQ,UAKzC;IAED;;;OAGG;IACH,uBAHW,MAAM,GACJ,OAAO,cAAc,EAAE,QAAQ,CAI3C;IAED,sEAEC;IAED;;oBAEqB,IAAI,GAAG,MAAM;qBAAW,MAAM;iBAAO,cAAc;;;MA8CvE;IAED,mDAgDC;IAED;;;OAGG;IACH,gBAHW,WAAW,OAKrB;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type Program = import("eslint").AST.Program;
|
|
2
|
+
export type AnyHTMLNode = import("@html-eslint/types").AnyHTMLNode;
|
|
3
|
+
export class HTMLTraversalStep extends VisitNodeStep {
|
|
4
|
+
/**
|
|
5
|
+
* @param {Object} options
|
|
6
|
+
* @param {AnyHTMLNode | Program} options.target
|
|
7
|
+
* @param {1|2} options.phase
|
|
8
|
+
* @param {Array<any>} options.args
|
|
9
|
+
*/
|
|
10
|
+
constructor({ target, phase, args }: {
|
|
11
|
+
target: AnyHTMLNode | Program;
|
|
12
|
+
phase: 1 | 2;
|
|
13
|
+
args: Array<any>;
|
|
14
|
+
});
|
|
15
|
+
target: import("eslint").AST.Program | import("@html-eslint/types").AnyHTMLNode;
|
|
16
|
+
}
|
|
17
|
+
export namespace STEP_PHASE {
|
|
18
|
+
let ENTER: 1;
|
|
19
|
+
let EXIT: 2;
|
|
20
|
+
}
|
|
21
|
+
import { VisitNodeStep } from "@eslint/plugin-kit";
|
|
22
|
+
//# sourceMappingURL=html-traversal-step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-traversal-step.d.ts","sourceRoot":"","sources":["../../lib/languages/html-traversal-step.js"],"names":[],"mappings":"sBACc,OAAO,QAAQ,EAAE,GAAG,CAAC,OAAO;0BAC7B,OAAO,oBAAoB,EAAE,WAAW;AAerD;IACE;;;;;OAKG;IACH,qCAJG;QAAuC,MAAM,EAArC,WAAW,GAAG,OAAO;QACR,KAAK,EAAlB,CAAC,GAAC,CAAC;QACiB,IAAI,EAAxB,KAAK,CAAC,GAAG,CAAC;KACpB,EAIA;IADC,gFAAoB;CAEvB;;eApBW,CAAC;cAID,CAAC"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
declare namespace _exports {
|
|
2
|
-
export { Tag, ScriptTag, StyleTag, Option, RuleModule };
|
|
2
|
+
export { Tag, ScriptTag, StyleTag, Attribute, Option, RuleModule, ReportFixFunction };
|
|
3
3
|
}
|
|
4
4
|
declare const _exports: RuleModule;
|
|
5
5
|
export = _exports;
|
|
6
6
|
type Tag = import("@html-eslint/types").Tag;
|
|
7
7
|
type ScriptTag = import("@html-eslint/types").ScriptTag;
|
|
8
8
|
type StyleTag = import("@html-eslint/types").StyleTag;
|
|
9
|
+
type Attribute = import("@html-eslint/types").Attribute;
|
|
9
10
|
type Option = {
|
|
10
11
|
tag: string;
|
|
11
12
|
attr: string;
|
|
12
13
|
value?: string | undefined;
|
|
13
14
|
};
|
|
14
15
|
type RuleModule = import("../types").RuleModule<Option[]>;
|
|
16
|
+
type ReportFixFunction = import("../types").ReportFixFunction;
|
|
15
17
|
//# sourceMappingURL=require-attrs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"require-attrs.d.ts","sourceRoot":"","sources":["../../lib/rules/require-attrs.js"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"require-attrs.d.ts","sourceRoot":"","sources":["../../lib/rules/require-attrs.js"],"names":[],"mappings":";;;wBA0BU,UAAU;;WAzBN,OAAO,oBAAoB,EAAE,GAAG;iBAChC,OAAO,oBAAoB,EAAE,SAAS;gBACtC,OAAO,oBAAoB,EAAE,QAAQ;iBACrC,OAAO,oBAAoB,EAAE,SAAS;;SAGtC,MAAM;UACN,MAAM;;;kBAGN,OAAO,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC;yBACvC,OAAO,UAAU,EAAE,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseline.d.ts","sourceRoot":"","sources":["../../../lib/rules/utils/baseline.js"],"names":[],"mappings":"AAOA,
|
|
1
|
+
{"version":3,"file":"baseline.d.ts","sourceRoot":"","sources":["../../../lib/rules/utils/baseline.js"],"names":[],"mappings":"AAOA,2CA4jBG;AACH,mDA4BG;AAhmBH;;GAEG;AACH,4BAAsB,EAAE,CAAC;AACzB,2BAAqB,CAAC,CAAC;AACvB,6BAAuB,CAAC,CAAC"}
|
package/types/types/rule.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export interface RuleFixer {
|
|
|
56
56
|
replaceText(nodeOrToken: AnyNodeAndLine, text: string): RuleFix;
|
|
57
57
|
replaceTextRange(range: eslint.AST.Range, text: string): RuleFix;
|
|
58
58
|
}
|
|
59
|
-
type ReportFixFunction = (fixer: RuleFixer) => IterableIterator<RuleFix> | readonly RuleFix[] | RuleFix | null;
|
|
59
|
+
export type ReportFixFunction = (fixer: RuleFixer) => IterableIterator<RuleFix> | readonly RuleFix[] | RuleFix | null;
|
|
60
60
|
interface ReportDescriptorOptionsBase {
|
|
61
61
|
data?: {
|
|
62
62
|
[key: string]: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule.d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