eslint-plugin-react-dom 1.52.9 → 1.52.10-beta.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/dist/index.d.mts +19 -20
- package/dist/index.d.ts +18 -20
- package/dist/index.js +1925 -1961
- package/dist/index.mjs +1905 -1938
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -1,2077 +1,2041 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var shared = require('@eslint-react/shared');
|
|
4
|
-
var ER = require('@eslint-react/core');
|
|
5
|
-
var utils = require('@typescript-eslint/utils');
|
|
6
|
-
var types = require('@typescript-eslint/types');
|
|
7
|
-
var compareVersions = require('compare-versions');
|
|
8
|
-
var kit = require('@eslint-react/kit');
|
|
9
|
-
var eff = require('@eslint-react/eff');
|
|
10
|
-
|
|
11
|
-
function _interopNamespace(e) {
|
|
12
|
-
if (e && e.__esModule) return e;
|
|
13
|
-
var n = Object.create(null);
|
|
14
|
-
if (e) {
|
|
15
|
-
Object.keys(e).forEach(function (k) {
|
|
16
|
-
if (k !== 'default') {
|
|
17
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () { return e[k]; }
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
n.default = e;
|
|
26
|
-
return Object.freeze(n);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var ER__namespace = /*#__PURE__*/_interopNamespace(ER);
|
|
30
|
-
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
31
3
|
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
32
8
|
var __export = (target, all) => {
|
|
33
|
-
|
|
34
|
-
|
|
9
|
+
for (var name$2 in all) __defProp(target, name$2, {
|
|
10
|
+
get: all[name$2],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
35
13
|
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
16
|
+
key = keys[i];
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
+
get: ((k) => from[k]).bind(null, key),
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
25
|
+
value: mod,
|
|
26
|
+
enumerable: true
|
|
27
|
+
}) : target, mod));
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
const __eslint_react_shared = __toESM(require("@eslint-react/shared"));
|
|
31
|
+
const __eslint_react_core = __toESM(require("@eslint-react/core"));
|
|
32
|
+
const __typescript_eslint_utils = __toESM(require("@typescript-eslint/utils"));
|
|
33
|
+
const __typescript_eslint_types = __toESM(require("@typescript-eslint/types"));
|
|
34
|
+
const compare_versions = __toESM(require("compare-versions"));
|
|
35
|
+
const __eslint_react_kit = __toESM(require("@eslint-react/kit"));
|
|
36
|
+
const __eslint_react_eff = __toESM(require("@eslint-react/eff"));
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
//#region src/configs/recommended.ts
|
|
38
39
|
var recommended_exports = {};
|
|
39
40
|
__export(recommended_exports, {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
name: () => name$1,
|
|
42
|
+
rules: () => rules,
|
|
43
|
+
settings: () => settings
|
|
43
44
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
};
|
|
62
|
-
var settings = {
|
|
63
|
-
"react-x": shared.DEFAULT_ESLINT_REACT_SETTINGS
|
|
45
|
+
const name$1 = "react-dom/recommended";
|
|
46
|
+
const rules = {
|
|
47
|
+
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
48
|
+
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
49
|
+
"react-dom/no-find-dom-node": "error",
|
|
50
|
+
"react-dom/no-flush-sync": "error",
|
|
51
|
+
"react-dom/no-hydrate": "error",
|
|
52
|
+
"react-dom/no-missing-button-type": "warn",
|
|
53
|
+
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
54
|
+
"react-dom/no-namespace": "error",
|
|
55
|
+
"react-dom/no-render": "error",
|
|
56
|
+
"react-dom/no-render-return-value": "error",
|
|
57
|
+
"react-dom/no-script-url": "warn",
|
|
58
|
+
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
59
|
+
"react-dom/no-unsafe-target-blank": "warn",
|
|
60
|
+
"react-dom/no-use-form-state": "error",
|
|
61
|
+
"react-dom/no-void-elements-with-children": "error"
|
|
64
62
|
};
|
|
63
|
+
const settings = { "react-x": __eslint_react_shared.DEFAULT_ESLINT_REACT_SETTINGS };
|
|
64
|
+
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region package.json
|
|
67
|
+
var name = "eslint-plugin-react-dom";
|
|
68
|
+
var version = "1.52.10-beta.1";
|
|
65
69
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var version = "1.52.9";
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/utils/create-jsx-element-resolver.ts
|
|
69
72
|
function createJsxElementResolver(context) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const polymorphicPropValue = ER__namespace.getAttributeValue(
|
|
92
|
-
context,
|
|
93
|
-
polymorphicPropAttr,
|
|
94
|
-
polymorphicPropName
|
|
95
|
-
);
|
|
96
|
-
if (polymorphicPropValue.kind === "some" && typeof polymorphicPropValue.value === "string") {
|
|
97
|
-
return {
|
|
98
|
-
...result,
|
|
99
|
-
domElementType: polymorphicPropValue.value
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return result;
|
|
104
|
-
}
|
|
105
|
-
};
|
|
73
|
+
const { components, polymorphicPropName } = (0, __eslint_react_shared.getSettingsFromContext)(context);
|
|
74
|
+
return { resolve(node) {
|
|
75
|
+
const name$2 = __eslint_react_core.getElementType(context, node);
|
|
76
|
+
const component = components.findLast((c) => c.name === name$2 || c.re.test(name$2));
|
|
77
|
+
const result = {
|
|
78
|
+
attributes: component?.attributes ?? [],
|
|
79
|
+
domElementType: component?.as ?? name$2,
|
|
80
|
+
jsxElementType: name$2
|
|
81
|
+
};
|
|
82
|
+
if (name$2 === name$2.toLowerCase() || component != null || polymorphicPropName == null) return result;
|
|
83
|
+
const initialScope = context.sourceCode.getScope(node);
|
|
84
|
+
const polymorphicPropAttr = __eslint_react_core.getAttribute(context, polymorphicPropName, node.openingElement.attributes, initialScope);
|
|
85
|
+
if (polymorphicPropAttr != null) {
|
|
86
|
+
const polymorphicPropValue = __eslint_react_core.getAttributeValue(context, polymorphicPropAttr, polymorphicPropName);
|
|
87
|
+
if (polymorphicPropValue.kind === "some" && typeof polymorphicPropValue.value === "string") return {
|
|
88
|
+
...result,
|
|
89
|
+
domElementType: polymorphicPropValue.value
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
93
|
+
} };
|
|
106
94
|
}
|
|
107
|
-
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("dom"));
|
|
108
95
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/utils/create-rule.ts
|
|
98
|
+
const createRule = __typescript_eslint_utils.ESLintUtils.RuleCreator((0, __eslint_react_shared.getDocsUrl)("dom"));
|
|
99
|
+
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/utils/find-custom-component.ts
|
|
102
|
+
function findCustomComponentProp(name$2, props) {
|
|
103
|
+
return props.findLast((a) => a.as === name$2);
|
|
112
104
|
}
|
|
113
105
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/rules/no-dangerously-set-innerhtml.ts
|
|
108
|
+
const RULE_NAME$15 = "no-dangerously-set-innerhtml";
|
|
109
|
+
const RULE_FEATURES$14 = [];
|
|
117
110
|
var no_dangerously_set_innerhtml_default = createRule({
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
create,
|
|
131
|
-
defaultOptions: []
|
|
111
|
+
meta: {
|
|
112
|
+
type: "problem",
|
|
113
|
+
docs: {
|
|
114
|
+
description: "Disallow `dangerouslySetInnerHTML`.",
|
|
115
|
+
[Symbol.for("rule_features")]: RULE_FEATURES$14
|
|
116
|
+
},
|
|
117
|
+
messages: { noDangerouslySetInnerhtml: "Using 'dangerouslySetInnerHTML' may have security implications." },
|
|
118
|
+
schema: []
|
|
119
|
+
},
|
|
120
|
+
name: RULE_NAME$15,
|
|
121
|
+
create: create$15,
|
|
122
|
+
defaultOptions: []
|
|
132
123
|
});
|
|
133
|
-
|
|
134
|
-
function create(context) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
if (attribute == null) return;
|
|
145
|
-
context.report({
|
|
146
|
-
messageId: "noDangerouslySetInnerhtml",
|
|
147
|
-
node: attribute
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
};
|
|
124
|
+
const dangerouslySetInnerHTML$1 = "dangerouslySetInnerHTML";
|
|
125
|
+
function create$15(context) {
|
|
126
|
+
if (!context.sourceCode.text.includes(dangerouslySetInnerHTML$1)) return {};
|
|
127
|
+
return { JSXElement(node) {
|
|
128
|
+
const attribute = __eslint_react_core.getAttribute(context, dangerouslySetInnerHTML$1, node.openingElement.attributes, context.sourceCode.getScope(node));
|
|
129
|
+
if (attribute == null) return;
|
|
130
|
+
context.report({
|
|
131
|
+
messageId: "noDangerouslySetInnerhtml",
|
|
132
|
+
node: attribute
|
|
133
|
+
});
|
|
134
|
+
} };
|
|
151
135
|
}
|
|
152
|
-
|
|
153
|
-
|
|
136
|
+
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/rules/no-dangerously-set-innerhtml-with-children.ts
|
|
139
|
+
const RULE_NAME$14 = "no-dangerously-set-innerhtml-with-children";
|
|
140
|
+
const RULE_FEATURES$13 = [];
|
|
154
141
|
var no_dangerously_set_innerhtml_with_children_default = createRule({
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
create: create2,
|
|
168
|
-
defaultOptions: []
|
|
142
|
+
meta: {
|
|
143
|
+
type: "problem",
|
|
144
|
+
docs: {
|
|
145
|
+
description: "Disallow `dangerouslySetInnerHTML` and `children` at the same time.",
|
|
146
|
+
[Symbol.for("rule_features")]: RULE_FEATURES$13
|
|
147
|
+
},
|
|
148
|
+
messages: { noDangerouslySetInnerhtmlWithChildren: "A DOM component cannot use both 'children' and 'dangerouslySetInnerHTML'." },
|
|
149
|
+
schema: []
|
|
150
|
+
},
|
|
151
|
+
name: RULE_NAME$14,
|
|
152
|
+
create: create$14,
|
|
153
|
+
defaultOptions: []
|
|
169
154
|
});
|
|
170
|
-
|
|
171
|
-
function
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
};
|
|
155
|
+
const dangerouslySetInnerHTML = "dangerouslySetInnerHTML";
|
|
156
|
+
function create$14(context) {
|
|
157
|
+
if (!context.sourceCode.text.includes(dangerouslySetInnerHTML)) return {};
|
|
158
|
+
return { JSXElement(node) {
|
|
159
|
+
const attributes = node.openingElement.attributes;
|
|
160
|
+
const initialScope = context.sourceCode.getScope(node);
|
|
161
|
+
const hasChildren = node.children.some(isSignificantChildren) || __eslint_react_core.hasAttribute(context, "children", attributes, initialScope);
|
|
162
|
+
if (hasChildren && __eslint_react_core.hasAttribute(context, dangerouslySetInnerHTML, attributes, initialScope)) context.report({
|
|
163
|
+
messageId: "noDangerouslySetInnerhtmlWithChildren",
|
|
164
|
+
node
|
|
165
|
+
});
|
|
166
|
+
} };
|
|
186
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Check if a Literal or JSXText node is whitespace
|
|
170
|
+
* @param node The AST node to check
|
|
171
|
+
* @returns boolean `true` if the node is whitespace
|
|
172
|
+
*/
|
|
187
173
|
function isWhiteSpace(node) {
|
|
188
|
-
|
|
174
|
+
return typeof node.value === "string" && node.raw.trim() === "";
|
|
189
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* Check if a Literal or JSXText node is padding spaces
|
|
178
|
+
* @param node The AST node to check
|
|
179
|
+
* @returns boolean
|
|
180
|
+
*/
|
|
190
181
|
function isPaddingSpaces(node) {
|
|
191
|
-
|
|
182
|
+
return __eslint_react_core.isJsxText(node) && isWhiteSpace(node) && node.raw.includes("\n");
|
|
192
183
|
}
|
|
193
184
|
function isSignificantChildren(node) {
|
|
194
|
-
|
|
185
|
+
return node.type !== __typescript_eslint_types.AST_NODE_TYPES.JSXText || !isPaddingSpaces(node);
|
|
195
186
|
}
|
|
196
|
-
|
|
197
|
-
|
|
187
|
+
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/rules/no-find-dom-node.ts
|
|
190
|
+
const RULE_NAME$13 = "no-find-dom-node";
|
|
191
|
+
const RULE_FEATURES$12 = [];
|
|
198
192
|
var no_find_dom_node_default = createRule({
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
create: create3,
|
|
212
|
-
defaultOptions: []
|
|
193
|
+
meta: {
|
|
194
|
+
type: "problem",
|
|
195
|
+
docs: {
|
|
196
|
+
description: "Disallow `findDOMNode`.",
|
|
197
|
+
[Symbol.for("rule_features")]: RULE_FEATURES$12
|
|
198
|
+
},
|
|
199
|
+
messages: { noFindDomNode: "[Deprecated] Use alternatives instead." },
|
|
200
|
+
schema: []
|
|
201
|
+
},
|
|
202
|
+
name: RULE_NAME$13,
|
|
203
|
+
create: create$13,
|
|
204
|
+
defaultOptions: []
|
|
213
205
|
});
|
|
214
|
-
|
|
215
|
-
function
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
206
|
+
const findDOMNode = "findDOMNode";
|
|
207
|
+
function create$13(context) {
|
|
208
|
+
if (!context.sourceCode.text.includes(findDOMNode)) return {};
|
|
209
|
+
return { CallExpression(node) {
|
|
210
|
+
const { callee } = node;
|
|
211
|
+
switch (callee.type) {
|
|
212
|
+
case __typescript_eslint_types.AST_NODE_TYPES.Identifier:
|
|
213
|
+
if (callee.name === findDOMNode) context.report({
|
|
214
|
+
messageId: "noFindDomNode",
|
|
215
|
+
node
|
|
216
|
+
});
|
|
217
|
+
return;
|
|
218
|
+
case __typescript_eslint_types.AST_NODE_TYPES.MemberExpression:
|
|
219
|
+
if (callee.property.type === __typescript_eslint_types.AST_NODE_TYPES.Identifier && callee.property.name === findDOMNode) context.report({
|
|
220
|
+
messageId: "noFindDomNode",
|
|
221
|
+
node
|
|
222
|
+
});
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
} };
|
|
234
226
|
}
|
|
235
|
-
|
|
236
|
-
|
|
227
|
+
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region src/rules/no-flush-sync.ts
|
|
230
|
+
const RULE_NAME$12 = "no-flush-sync";
|
|
231
|
+
const RULE_FEATURES$11 = [];
|
|
237
232
|
var no_flush_sync_default = createRule({
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
create: create4,
|
|
251
|
-
defaultOptions: []
|
|
233
|
+
meta: {
|
|
234
|
+
type: "problem",
|
|
235
|
+
docs: {
|
|
236
|
+
description: "Disallow `flushSync`.",
|
|
237
|
+
[Symbol.for("rule_features")]: RULE_FEATURES$11
|
|
238
|
+
},
|
|
239
|
+
messages: { noFlushSync: "Using 'flushSync' is uncommon and can hurt the performance of your app." },
|
|
240
|
+
schema: []
|
|
241
|
+
},
|
|
242
|
+
name: RULE_NAME$12,
|
|
243
|
+
create: create$12,
|
|
244
|
+
defaultOptions: []
|
|
252
245
|
});
|
|
253
|
-
|
|
254
|
-
function
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
246
|
+
const flushSync = "flushSync";
|
|
247
|
+
function create$12(context) {
|
|
248
|
+
if (!context.sourceCode.text.includes(flushSync)) return {};
|
|
249
|
+
return { CallExpression(node) {
|
|
250
|
+
const { callee } = node;
|
|
251
|
+
switch (callee.type) {
|
|
252
|
+
case __typescript_eslint_types.AST_NODE_TYPES.Identifier:
|
|
253
|
+
if (callee.name === flushSync) context.report({
|
|
254
|
+
messageId: "noFlushSync",
|
|
255
|
+
node
|
|
256
|
+
});
|
|
257
|
+
return;
|
|
258
|
+
case __typescript_eslint_types.AST_NODE_TYPES.MemberExpression:
|
|
259
|
+
if (callee.property.type === __typescript_eslint_types.AST_NODE_TYPES.Identifier && callee.property.name === flushSync) context.report({
|
|
260
|
+
messageId: "noFlushSync",
|
|
261
|
+
node
|
|
262
|
+
});
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
} };
|
|
273
266
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
267
|
+
|
|
268
|
+
//#endregion
|
|
269
|
+
//#region src/rules/no-hydrate.ts
|
|
270
|
+
const RULE_NAME$11 = "no-hydrate";
|
|
271
|
+
const RULE_FEATURES$10 = ["MOD"];
|
|
278
272
|
var no_hydrate_default = createRule({
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
create: create5,
|
|
293
|
-
defaultOptions: []
|
|
273
|
+
meta: {
|
|
274
|
+
type: "problem",
|
|
275
|
+
docs: {
|
|
276
|
+
description: "Replaces usages of `ReactDom.hydrate()` with `hydrateRoot()`.",
|
|
277
|
+
[Symbol.for("rule_features")]: RULE_FEATURES$10
|
|
278
|
+
},
|
|
279
|
+
fixable: "code",
|
|
280
|
+
messages: { noHydrate: "[Deprecated] Use 'hydrateRoot()' instead." },
|
|
281
|
+
schema: []
|
|
282
|
+
},
|
|
283
|
+
name: RULE_NAME$11,
|
|
284
|
+
create: create$11,
|
|
285
|
+
defaultOptions: []
|
|
294
286
|
});
|
|
295
|
-
|
|
296
|
-
function
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
};
|
|
287
|
+
const hydrate = "hydrate";
|
|
288
|
+
function create$11(context) {
|
|
289
|
+
if (!context.sourceCode.text.includes(hydrate)) return {};
|
|
290
|
+
const settings$1 = (0, __eslint_react_shared.getSettingsFromContext)(context);
|
|
291
|
+
if ((0, compare_versions.compare)(settings$1.version, "18.0.0", "<")) return {};
|
|
292
|
+
const reactDomNames = /* @__PURE__ */ new Set();
|
|
293
|
+
const hydrateNames = /* @__PURE__ */ new Set();
|
|
294
|
+
return {
|
|
295
|
+
CallExpression(node) {
|
|
296
|
+
switch (true) {
|
|
297
|
+
case node.callee.type === __typescript_eslint_types.AST_NODE_TYPES.Identifier && hydrateNames.has(node.callee.name):
|
|
298
|
+
context.report({
|
|
299
|
+
messageId: "noHydrate",
|
|
300
|
+
node,
|
|
301
|
+
fix: getFix$2(context, node)
|
|
302
|
+
});
|
|
303
|
+
return;
|
|
304
|
+
case node.callee.type === __typescript_eslint_types.AST_NODE_TYPES.MemberExpression && node.callee.object.type === __typescript_eslint_types.AST_NODE_TYPES.Identifier && node.callee.property.type === __typescript_eslint_types.AST_NODE_TYPES.Identifier && node.callee.property.name === hydrate && reactDomNames.has(node.callee.object.name):
|
|
305
|
+
context.report({
|
|
306
|
+
messageId: "noHydrate",
|
|
307
|
+
node,
|
|
308
|
+
fix: getFix$2(context, node)
|
|
309
|
+
});
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
ImportDeclaration(node) {
|
|
314
|
+
const [baseSource] = node.source.value.split("/");
|
|
315
|
+
if (baseSource !== "react-dom") return;
|
|
316
|
+
for (const specifier of node.specifiers) switch (specifier.type) {
|
|
317
|
+
case __typescript_eslint_types.AST_NODE_TYPES.ImportSpecifier:
|
|
318
|
+
if (specifier.imported.type !== __typescript_eslint_types.AST_NODE_TYPES.Identifier) continue;
|
|
319
|
+
if (specifier.imported.name === hydrate) hydrateNames.add(specifier.local.name);
|
|
320
|
+
continue;
|
|
321
|
+
case __typescript_eslint_types.AST_NODE_TYPES.ImportDefaultSpecifier:
|
|
322
|
+
case __typescript_eslint_types.AST_NODE_TYPES.ImportNamespaceSpecifier:
|
|
323
|
+
reactDomNames.add(specifier.local.name);
|
|
324
|
+
continue;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
};
|
|
340
328
|
}
|
|
341
|
-
function getFix(context, node) {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
fixer.replaceText(node, `hydrateRoot(${getText2(arg1)}, ${getText2(arg0)})`)
|
|
349
|
-
];
|
|
350
|
-
};
|
|
329
|
+
function getFix$2(context, node) {
|
|
330
|
+
const getText$1 = (n) => context.sourceCode.getText(n);
|
|
331
|
+
return (fixer) => {
|
|
332
|
+
const [arg0, arg1] = node.arguments;
|
|
333
|
+
if (arg0 == null || arg1 == null) return null;
|
|
334
|
+
return [fixer.insertTextBefore(context.sourceCode.ast, "import { hydrateRoot } from \"react-dom/client\";\n"), fixer.replaceText(node, `hydrateRoot(${getText$1(arg1)}, ${getText$1(arg0)})`)];
|
|
335
|
+
};
|
|
351
336
|
}
|
|
352
|
-
|
|
353
|
-
|
|
337
|
+
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region src/rules/no-missing-button-type.ts
|
|
340
|
+
const RULE_NAME$10 = "no-missing-button-type";
|
|
341
|
+
const RULE_FEATURES$9 = [];
|
|
354
342
|
var no_missing_button_type_default = createRule({
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
create: create6,
|
|
368
|
-
defaultOptions: []
|
|
343
|
+
meta: {
|
|
344
|
+
type: "problem",
|
|
345
|
+
docs: {
|
|
346
|
+
description: "Enforces explicit `type` attribute for `button` elements.",
|
|
347
|
+
[Symbol.for("rule_features")]: RULE_FEATURES$9
|
|
348
|
+
},
|
|
349
|
+
messages: { noMissingButtonType: "Add missing 'type' attribute on 'button' component." },
|
|
350
|
+
schema: []
|
|
351
|
+
},
|
|
352
|
+
name: RULE_NAME$10,
|
|
353
|
+
create: create$10,
|
|
354
|
+
defaultOptions: []
|
|
369
355
|
});
|
|
370
|
-
function
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
context.report({
|
|
392
|
-
messageId: "noMissingButtonType",
|
|
393
|
-
node: attributeNode
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
return;
|
|
397
|
-
}
|
|
398
|
-
if (typeof customComponentProp?.defaultValue !== "string") {
|
|
399
|
-
context.report({
|
|
400
|
-
messageId: "noMissingButtonType",
|
|
401
|
-
node
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
};
|
|
356
|
+
function create$10(context) {
|
|
357
|
+
const resolver = createJsxElementResolver(context);
|
|
358
|
+
return { JSXElement(node) {
|
|
359
|
+
const { attributes, domElementType } = resolver.resolve(node);
|
|
360
|
+
if (domElementType !== "button") return;
|
|
361
|
+
const customComponentProp = findCustomComponentProp("type", attributes);
|
|
362
|
+
const propNameOnJsx = customComponentProp?.name ?? "type";
|
|
363
|
+
const attributeNode = __eslint_react_core.getAttribute(context, propNameOnJsx, node.openingElement.attributes, context.sourceCode.getScope(node));
|
|
364
|
+
if (attributeNode != null) {
|
|
365
|
+
const attributeValue = __eslint_react_core.getAttributeValue(context, attributeNode, propNameOnJsx);
|
|
366
|
+
if (attributeValue.kind === "some" && typeof attributeValue.value !== "string") context.report({
|
|
367
|
+
messageId: "noMissingButtonType",
|
|
368
|
+
node: attributeNode
|
|
369
|
+
});
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
if (typeof customComponentProp?.defaultValue !== "string") context.report({
|
|
373
|
+
messageId: "noMissingButtonType",
|
|
374
|
+
node
|
|
375
|
+
});
|
|
376
|
+
} };
|
|
406
377
|
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
378
|
+
|
|
379
|
+
//#endregion
|
|
380
|
+
//#region src/rules/no-missing-iframe-sandbox.ts
|
|
381
|
+
const RULE_NAME$9 = "no-missing-iframe-sandbox";
|
|
382
|
+
const RULE_FEATURES$8 = [];
|
|
383
|
+
const validTypes = [
|
|
384
|
+
"",
|
|
385
|
+
"allow-downloads",
|
|
386
|
+
"allow-downloads-without-user-activation",
|
|
387
|
+
"allow-forms",
|
|
388
|
+
"allow-modals",
|
|
389
|
+
"allow-orientation-lock",
|
|
390
|
+
"allow-pointer-lock",
|
|
391
|
+
"allow-popups",
|
|
392
|
+
"allow-popups-to-escape-sandbox",
|
|
393
|
+
"allow-presentation",
|
|
394
|
+
"allow-same-origin",
|
|
395
|
+
"allow-scripts",
|
|
396
|
+
"allow-storage-access-by-user-activation",
|
|
397
|
+
"allow-top-navigation",
|
|
398
|
+
"allow-top-navigation-by-user-activation",
|
|
399
|
+
"allow-top-navigation-to-custom-protocols"
|
|
426
400
|
];
|
|
427
401
|
function hasValidSandBox(value) {
|
|
428
|
-
|
|
402
|
+
return typeof value === "string" && value.split(" ").every((value$1) => validTypes.some((valid) => valid === value$1));
|
|
429
403
|
}
|
|
430
404
|
var no_missing_iframe_sandbox_default = createRule({
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
create: create7,
|
|
444
|
-
defaultOptions: []
|
|
405
|
+
meta: {
|
|
406
|
+
type: "problem",
|
|
407
|
+
docs: {
|
|
408
|
+
description: "Enforces explicit `sandbox` attribute for `iframe` elements.",
|
|
409
|
+
[Symbol.for("rule_features")]: RULE_FEATURES$8
|
|
410
|
+
},
|
|
411
|
+
messages: { noMissingIframeSandbox: "Add missing 'sandbox' attribute on 'iframe' component." },
|
|
412
|
+
schema: []
|
|
413
|
+
},
|
|
414
|
+
name: RULE_NAME$9,
|
|
415
|
+
create: create$9,
|
|
416
|
+
defaultOptions: []
|
|
445
417
|
});
|
|
446
|
-
function
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
messageId: "noMissingIframeSandbox",
|
|
469
|
-
node: attributeNode
|
|
470
|
-
});
|
|
471
|
-
return;
|
|
472
|
-
}
|
|
473
|
-
if (!hasValidSandBox(customComponentProp?.defaultValue)) {
|
|
474
|
-
context.report({
|
|
475
|
-
messageId: "noMissingIframeSandbox",
|
|
476
|
-
node
|
|
477
|
-
});
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
};
|
|
418
|
+
function create$9(context) {
|
|
419
|
+
const resolver = createJsxElementResolver(context);
|
|
420
|
+
return { JSXElement(node) {
|
|
421
|
+
const { attributes, domElementType } = resolver.resolve(node);
|
|
422
|
+
if (domElementType !== "iframe") return;
|
|
423
|
+
const customComponentProp = findCustomComponentProp("sandbox", attributes);
|
|
424
|
+
const propNameOnJsx = customComponentProp?.name ?? "sandbox";
|
|
425
|
+
const attributeNode = __eslint_react_core.getAttribute(context, propNameOnJsx, node.openingElement.attributes, context.sourceCode.getScope(node));
|
|
426
|
+
if (attributeNode != null) {
|
|
427
|
+
const attributeValue = __eslint_react_core.getAttributeValue(context, attributeNode, propNameOnJsx);
|
|
428
|
+
if (attributeValue.kind === "some" && hasValidSandBox(attributeValue.value)) return;
|
|
429
|
+
context.report({
|
|
430
|
+
messageId: "noMissingIframeSandbox",
|
|
431
|
+
node: attributeNode
|
|
432
|
+
});
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
if (!hasValidSandBox(customComponentProp?.defaultValue)) context.report({
|
|
436
|
+
messageId: "noMissingIframeSandbox",
|
|
437
|
+
node
|
|
438
|
+
});
|
|
439
|
+
} };
|
|
481
440
|
}
|
|
482
|
-
|
|
483
|
-
|
|
441
|
+
|
|
442
|
+
//#endregion
|
|
443
|
+
//#region src/rules/no-namespace.ts
|
|
444
|
+
const RULE_NAME$8 = "no-namespace";
|
|
445
|
+
const RULE_FEATURES$7 = [];
|
|
484
446
|
var no_namespace_default = createRule({
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
create: create8,
|
|
498
|
-
defaultOptions: []
|
|
447
|
+
meta: {
|
|
448
|
+
type: "problem",
|
|
449
|
+
docs: {
|
|
450
|
+
description: "Enforces the absence of a `namespace` in React elements.",
|
|
451
|
+
[Symbol.for("rule_features")]: RULE_FEATURES$7
|
|
452
|
+
},
|
|
453
|
+
messages: { noNamespace: "A React component '{{name}}' must not be in a namespace, as React does not support them." },
|
|
454
|
+
schema: []
|
|
455
|
+
},
|
|
456
|
+
name: RULE_NAME$8,
|
|
457
|
+
create: create$8,
|
|
458
|
+
defaultOptions: []
|
|
499
459
|
});
|
|
500
|
-
function
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
data: {
|
|
511
|
-
name: name3
|
|
512
|
-
}
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
};
|
|
460
|
+
function create$8(context) {
|
|
461
|
+
return { JSXElement(node) {
|
|
462
|
+
const name$2 = __eslint_react_core.getElementType(context, node);
|
|
463
|
+
if (typeof name$2 !== "string" || !name$2.includes(":")) return;
|
|
464
|
+
context.report({
|
|
465
|
+
messageId: "noNamespace",
|
|
466
|
+
node: node.openingElement.name,
|
|
467
|
+
data: { name: name$2 }
|
|
468
|
+
});
|
|
469
|
+
} };
|
|
516
470
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
471
|
+
|
|
472
|
+
//#endregion
|
|
473
|
+
//#region src/rules/no-render.ts
|
|
474
|
+
const RULE_NAME$7 = "no-render";
|
|
475
|
+
const RULE_FEATURES$6 = ["MOD"];
|
|
521
476
|
var no_render_default = createRule({
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
create: create9,
|
|
536
|
-
defaultOptions: []
|
|
477
|
+
meta: {
|
|
478
|
+
type: "problem",
|
|
479
|
+
docs: {
|
|
480
|
+
description: "Replaces usages of `ReactDom.render()` with `createRoot(node).render()`.",
|
|
481
|
+
[Symbol.for("rule_features")]: RULE_FEATURES$6
|
|
482
|
+
},
|
|
483
|
+
fixable: "code",
|
|
484
|
+
messages: { noRender: "[Deprecated] Use 'createRoot(node).render()' instead." },
|
|
485
|
+
schema: []
|
|
486
|
+
},
|
|
487
|
+
name: RULE_NAME$7,
|
|
488
|
+
create: create$7,
|
|
489
|
+
defaultOptions: []
|
|
537
490
|
});
|
|
538
|
-
function
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
};
|
|
491
|
+
function create$7(context) {
|
|
492
|
+
if (!context.sourceCode.text.includes("render")) return {};
|
|
493
|
+
const settings$1 = (0, __eslint_react_shared.getSettingsFromContext)(context);
|
|
494
|
+
if ((0, compare_versions.compare)(settings$1.version, "18.0.0", "<")) return {};
|
|
495
|
+
const reactDomNames = new Set(["ReactDOM", "ReactDom"]);
|
|
496
|
+
const renderNames = /* @__PURE__ */ new Set();
|
|
497
|
+
return {
|
|
498
|
+
CallExpression(node) {
|
|
499
|
+
switch (true) {
|
|
500
|
+
case node.callee.type === __typescript_eslint_types.AST_NODE_TYPES.Identifier && renderNames.has(node.callee.name):
|
|
501
|
+
context.report({
|
|
502
|
+
messageId: "noRender",
|
|
503
|
+
node,
|
|
504
|
+
fix: getFix$1(context, node)
|
|
505
|
+
});
|
|
506
|
+
return;
|
|
507
|
+
case node.callee.type === __typescript_eslint_types.AST_NODE_TYPES.MemberExpression && node.callee.object.type === __typescript_eslint_types.AST_NODE_TYPES.Identifier && node.callee.property.type === __typescript_eslint_types.AST_NODE_TYPES.Identifier && node.callee.property.name === "render" && reactDomNames.has(node.callee.object.name):
|
|
508
|
+
context.report({
|
|
509
|
+
messageId: "noRender",
|
|
510
|
+
node,
|
|
511
|
+
fix: getFix$1(context, node)
|
|
512
|
+
});
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
ImportDeclaration(node) {
|
|
517
|
+
const [baseSource] = node.source.value.split("/");
|
|
518
|
+
if (baseSource !== "react-dom") return;
|
|
519
|
+
for (const specifier of node.specifiers) switch (specifier.type) {
|
|
520
|
+
case __typescript_eslint_types.AST_NODE_TYPES.ImportSpecifier:
|
|
521
|
+
if (specifier.imported.type !== __typescript_eslint_types.AST_NODE_TYPES.Identifier) continue;
|
|
522
|
+
if (specifier.imported.name === "render") renderNames.add(specifier.local.name);
|
|
523
|
+
continue;
|
|
524
|
+
case __typescript_eslint_types.AST_NODE_TYPES.ImportDefaultSpecifier:
|
|
525
|
+
case __typescript_eslint_types.AST_NODE_TYPES.ImportNamespaceSpecifier:
|
|
526
|
+
reactDomNames.add(specifier.local.name);
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
};
|
|
582
531
|
}
|
|
583
|
-
function
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
fixer.replaceText(node, `createRoot(${getText2(arg1)}).render(${getText2(arg0)})`)
|
|
591
|
-
];
|
|
592
|
-
};
|
|
532
|
+
function getFix$1(context, node) {
|
|
533
|
+
const getText$1 = (n) => context.sourceCode.getText(n);
|
|
534
|
+
return (fixer) => {
|
|
535
|
+
const [arg0, arg1] = node.arguments;
|
|
536
|
+
if (arg0 == null || arg1 == null) return null;
|
|
537
|
+
return [fixer.insertTextBefore(context.sourceCode.ast, "import { createRoot } from \"react-dom/client\";\n"), fixer.replaceText(node, `createRoot(${getText$1(arg1)}).render(${getText$1(arg0)})`)];
|
|
538
|
+
};
|
|
593
539
|
}
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
540
|
+
|
|
541
|
+
//#endregion
|
|
542
|
+
//#region src/rules/no-render-return-value.ts
|
|
543
|
+
const RULE_NAME$6 = "no-render-return-value";
|
|
544
|
+
const RULE_FEATURES$5 = [];
|
|
545
|
+
const banParentTypes = [
|
|
546
|
+
__typescript_eslint_types.AST_NODE_TYPES.VariableDeclarator,
|
|
547
|
+
__typescript_eslint_types.AST_NODE_TYPES.Property,
|
|
548
|
+
__typescript_eslint_types.AST_NODE_TYPES.ReturnStatement,
|
|
549
|
+
__typescript_eslint_types.AST_NODE_TYPES.ArrowFunctionExpression,
|
|
550
|
+
__typescript_eslint_types.AST_NODE_TYPES.AssignmentExpression
|
|
602
551
|
];
|
|
603
552
|
var no_render_return_value_default = createRule({
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
create: create10,
|
|
617
|
-
defaultOptions: []
|
|
553
|
+
meta: {
|
|
554
|
+
type: "problem",
|
|
555
|
+
docs: {
|
|
556
|
+
description: "Disallow the return value of `ReactDOM.render`.",
|
|
557
|
+
[Symbol.for("rule_features")]: RULE_FEATURES$5
|
|
558
|
+
},
|
|
559
|
+
messages: { noRenderReturnValue: "Do not depend on the return value from 'ReactDOM.render'." },
|
|
560
|
+
schema: []
|
|
561
|
+
},
|
|
562
|
+
name: RULE_NAME$6,
|
|
563
|
+
create: create$6,
|
|
564
|
+
defaultOptions: []
|
|
618
565
|
});
|
|
619
|
-
function
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
};
|
|
566
|
+
function create$6(context) {
|
|
567
|
+
const reactDomNames = new Set(["ReactDOM", "ReactDom"]);
|
|
568
|
+
const renderNames = /* @__PURE__ */ new Set();
|
|
569
|
+
return {
|
|
570
|
+
CallExpression(node) {
|
|
571
|
+
switch (true) {
|
|
572
|
+
case node.callee.type === __typescript_eslint_types.AST_NODE_TYPES.Identifier && renderNames.has(node.callee.name) && banParentTypes.includes(node.parent.type):
|
|
573
|
+
context.report({
|
|
574
|
+
messageId: "noRenderReturnValue",
|
|
575
|
+
node
|
|
576
|
+
});
|
|
577
|
+
return;
|
|
578
|
+
case node.callee.type === __typescript_eslint_types.AST_NODE_TYPES.MemberExpression && node.callee.object.type === __typescript_eslint_types.AST_NODE_TYPES.Identifier && node.callee.property.type === __typescript_eslint_types.AST_NODE_TYPES.Identifier && node.callee.property.name === "render" && reactDomNames.has(node.callee.object.name) && banParentTypes.includes(node.parent.type):
|
|
579
|
+
context.report({
|
|
580
|
+
messageId: "noRenderReturnValue",
|
|
581
|
+
node
|
|
582
|
+
});
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
},
|
|
586
|
+
ImportDeclaration(node) {
|
|
587
|
+
const [baseSource] = node.source.value.split("/");
|
|
588
|
+
if (baseSource !== "react-dom") return;
|
|
589
|
+
for (const specifier of node.specifiers) switch (specifier.type) {
|
|
590
|
+
case __typescript_eslint_types.AST_NODE_TYPES.ImportSpecifier:
|
|
591
|
+
if (specifier.imported.type !== __typescript_eslint_types.AST_NODE_TYPES.Identifier) continue;
|
|
592
|
+
if (specifier.imported.name === "render") renderNames.add(specifier.local.name);
|
|
593
|
+
continue;
|
|
594
|
+
case __typescript_eslint_types.AST_NODE_TYPES.ImportDefaultSpecifier:
|
|
595
|
+
case __typescript_eslint_types.AST_NODE_TYPES.ImportNamespaceSpecifier:
|
|
596
|
+
reactDomNames.add(specifier.local.name);
|
|
597
|
+
continue;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
};
|
|
658
601
|
}
|
|
659
|
-
|
|
660
|
-
|
|
602
|
+
|
|
603
|
+
//#endregion
|
|
604
|
+
//#region src/rules/no-script-url.ts
|
|
605
|
+
const RULE_NAME$5 = "no-script-url";
|
|
606
|
+
const RULE_FEATURES$4 = [];
|
|
607
|
+
/**
|
|
608
|
+
* This rule is adapted from eslint-plugin-solid's jsx-no-script-url rule under the MIT license.
|
|
609
|
+
* Thank you for your work!
|
|
610
|
+
*/
|
|
661
611
|
var no_script_url_default = createRule({
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
create: create11,
|
|
675
|
-
defaultOptions: []
|
|
612
|
+
meta: {
|
|
613
|
+
type: "problem",
|
|
614
|
+
docs: {
|
|
615
|
+
description: "Disallow `javascript:` URLs as attribute values.",
|
|
616
|
+
[Symbol.for("rule_features")]: RULE_FEATURES$4
|
|
617
|
+
},
|
|
618
|
+
messages: { noScriptUrl: "Using a `javascript:` URL is a security risk and should be avoided." },
|
|
619
|
+
schema: []
|
|
620
|
+
},
|
|
621
|
+
name: RULE_NAME$5,
|
|
622
|
+
create: create$5,
|
|
623
|
+
defaultOptions: []
|
|
676
624
|
});
|
|
677
|
-
function
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
messageId: "noScriptUrl",
|
|
688
|
-
node: node.value
|
|
689
|
-
});
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
};
|
|
625
|
+
function create$5(context) {
|
|
626
|
+
return { JSXAttribute(node) {
|
|
627
|
+
if (node.name.type !== __typescript_eslint_types.AST_NODE_TYPES.JSXIdentifier || node.value == null) return;
|
|
628
|
+
const attributeValue = __eslint_react_core.getAttributeValue(context, node, __eslint_react_core.getAttributeName(context, node));
|
|
629
|
+
if (attributeValue.kind === "none" || typeof attributeValue.value !== "string") return;
|
|
630
|
+
if (__eslint_react_kit.RegExp.JAVASCRIPT_PROTOCOL.test(attributeValue.value)) context.report({
|
|
631
|
+
messageId: "noScriptUrl",
|
|
632
|
+
node: node.value
|
|
633
|
+
});
|
|
634
|
+
} };
|
|
693
635
|
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
636
|
+
|
|
637
|
+
//#endregion
|
|
638
|
+
//#region src/rules/no-unknown-property.ts
|
|
639
|
+
const RULE_NAME$4 = "no-unknown-property";
|
|
640
|
+
const DEFAULTS = {
|
|
641
|
+
ignore: [],
|
|
642
|
+
requireDataLowercase: false
|
|
698
643
|
};
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
644
|
+
/**
|
|
645
|
+
* Map of standard HTML attributes to their React counterparts
|
|
646
|
+
*/
|
|
647
|
+
const DOM_ATTRIBUTE_NAMES = {
|
|
648
|
+
"accept-charset": "acceptCharset",
|
|
649
|
+
class: "className",
|
|
650
|
+
crossorigin: "crossOrigin",
|
|
651
|
+
for: "htmlFor",
|
|
652
|
+
"http-equiv": "httpEquiv",
|
|
653
|
+
nomodule: "noModule"
|
|
706
654
|
};
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
655
|
+
/**
|
|
656
|
+
* Map of SVG attributes to their React camelCase equivalents
|
|
657
|
+
*/
|
|
658
|
+
const SVGDOM_ATTRIBUTE_NAMES = {
|
|
659
|
+
"accent-height": "accentHeight",
|
|
660
|
+
"alignment-baseline": "alignmentBaseline",
|
|
661
|
+
"arabic-form": "arabicForm",
|
|
662
|
+
"baseline-shift": "baselineShift",
|
|
663
|
+
"cap-height": "capHeight",
|
|
664
|
+
"clip-path": "clipPath",
|
|
665
|
+
"clip-rule": "clipRule",
|
|
666
|
+
"color-interpolation": "colorInterpolation",
|
|
667
|
+
"color-interpolation-filters": "colorInterpolationFilters",
|
|
668
|
+
"color-profile": "colorProfile",
|
|
669
|
+
"color-rendering": "colorRendering",
|
|
670
|
+
"dominant-baseline": "dominantBaseline",
|
|
671
|
+
"enable-background": "enableBackground",
|
|
672
|
+
"fill-opacity": "fillOpacity",
|
|
673
|
+
"fill-rule": "fillRule",
|
|
674
|
+
"flood-color": "floodColor",
|
|
675
|
+
"flood-opacity": "floodOpacity",
|
|
676
|
+
"font-family": "fontFamily",
|
|
677
|
+
"font-size": "fontSize",
|
|
678
|
+
"font-size-adjust": "fontSizeAdjust",
|
|
679
|
+
"font-stretch": "fontStretch",
|
|
680
|
+
"font-style": "fontStyle",
|
|
681
|
+
"font-variant": "fontVariant",
|
|
682
|
+
"font-weight": "fontWeight",
|
|
683
|
+
"glyph-name": "glyphName",
|
|
684
|
+
"glyph-orientation-horizontal": "glyphOrientationHorizontal",
|
|
685
|
+
"glyph-orientation-vertical": "glyphOrientationVertical",
|
|
686
|
+
"horiz-adv-x": "horizAdvX",
|
|
687
|
+
"horiz-origin-x": "horizOriginX",
|
|
688
|
+
"image-rendering": "imageRendering",
|
|
689
|
+
"letter-spacing": "letterSpacing",
|
|
690
|
+
"lighting-color": "lightingColor",
|
|
691
|
+
"marker-end": "markerEnd",
|
|
692
|
+
"marker-mid": "markerMid",
|
|
693
|
+
"marker-start": "markerStart",
|
|
694
|
+
"overline-position": "overlinePosition",
|
|
695
|
+
"overline-thickness": "overlineThickness",
|
|
696
|
+
"paint-order": "paintOrder",
|
|
697
|
+
"panose-1": "panose1",
|
|
698
|
+
"pointer-events": "pointerEvents",
|
|
699
|
+
"rendering-intent": "renderingIntent",
|
|
700
|
+
"shape-rendering": "shapeRendering",
|
|
701
|
+
"stop-color": "stopColor",
|
|
702
|
+
"stop-opacity": "stopOpacity",
|
|
703
|
+
"strikethrough-position": "strikethroughPosition",
|
|
704
|
+
"strikethrough-thickness": "strikethroughThickness",
|
|
705
|
+
"stroke-dasharray": "strokeDasharray",
|
|
706
|
+
"stroke-dashoffset": "strokeDashoffset",
|
|
707
|
+
"stroke-linecap": "strokeLinecap",
|
|
708
|
+
"stroke-linejoin": "strokeLinejoin",
|
|
709
|
+
"stroke-miterlimit": "strokeMiterlimit",
|
|
710
|
+
"stroke-opacity": "strokeOpacity",
|
|
711
|
+
"stroke-width": "strokeWidth",
|
|
712
|
+
"text-anchor": "textAnchor",
|
|
713
|
+
"text-decoration": "textDecoration",
|
|
714
|
+
"text-rendering": "textRendering",
|
|
715
|
+
"underline-position": "underlinePosition",
|
|
716
|
+
"underline-thickness": "underlineThickness",
|
|
717
|
+
"unicode-bidi": "unicodeBidi",
|
|
718
|
+
"unicode-range": "unicodeRange",
|
|
719
|
+
"units-per-em": "unitsPerEm",
|
|
720
|
+
"v-alphabetic": "vAlphabetic",
|
|
721
|
+
"v-hanging": "vHanging",
|
|
722
|
+
"v-ideographic": "vIdeographic",
|
|
723
|
+
"v-mathematical": "vMathematical",
|
|
724
|
+
"vector-effect": "vectorEffect",
|
|
725
|
+
"vert-adv-y": "vertAdvY",
|
|
726
|
+
"vert-origin-x": "vertOriginX",
|
|
727
|
+
"vert-origin-y": "vertOriginY",
|
|
728
|
+
"word-spacing": "wordSpacing",
|
|
729
|
+
"writing-mode": "writingMode",
|
|
730
|
+
"x-height": "xHeight",
|
|
731
|
+
"xlink:actuate": "xlinkActuate",
|
|
732
|
+
"xlink:arcrole": "xlinkArcrole",
|
|
733
|
+
"xlink:href": "xlinkHref",
|
|
734
|
+
"xlink:role": "xlinkRole",
|
|
735
|
+
"xlink:show": "xlinkShow",
|
|
736
|
+
"xlink:title": "xlinkTitle",
|
|
737
|
+
"xlink:type": "xlinkType",
|
|
738
|
+
"xml:base": "xmlBase",
|
|
739
|
+
"xml:lang": "xmlLang",
|
|
740
|
+
"xml:space": "xmlSpace"
|
|
790
741
|
};
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
742
|
+
/**
|
|
743
|
+
* Map of attributes that are only valid on specific HTML tags
|
|
744
|
+
*/
|
|
745
|
+
const ATTRIBUTE_TAGS_MAP = {
|
|
746
|
+
as: ["link"],
|
|
747
|
+
abbr: ["th", "td"],
|
|
748
|
+
align: [
|
|
749
|
+
"applet",
|
|
750
|
+
"caption",
|
|
751
|
+
"col",
|
|
752
|
+
"colgroup",
|
|
753
|
+
"hr",
|
|
754
|
+
"iframe",
|
|
755
|
+
"img",
|
|
756
|
+
"table",
|
|
757
|
+
"tbody",
|
|
758
|
+
"td",
|
|
759
|
+
"tfoot",
|
|
760
|
+
"th",
|
|
761
|
+
"thead",
|
|
762
|
+
"tr"
|
|
763
|
+
],
|
|
764
|
+
allowFullScreen: ["iframe", "video"],
|
|
765
|
+
autoPictureInPicture: ["video"],
|
|
766
|
+
charset: ["meta"],
|
|
767
|
+
checked: ["input"],
|
|
768
|
+
controls: ["audio", "video"],
|
|
769
|
+
controlsList: ["audio", "video"],
|
|
770
|
+
crossOrigin: [
|
|
771
|
+
"script",
|
|
772
|
+
"img",
|
|
773
|
+
"video",
|
|
774
|
+
"audio",
|
|
775
|
+
"link",
|
|
776
|
+
"image"
|
|
777
|
+
],
|
|
778
|
+
disablePictureInPicture: ["video"],
|
|
779
|
+
disableRemotePlayback: ["audio", "video"],
|
|
780
|
+
displaystyle: ["math"],
|
|
781
|
+
download: ["a", "area"],
|
|
782
|
+
fill: [
|
|
783
|
+
"altGlyph",
|
|
784
|
+
"circle",
|
|
785
|
+
"ellipse",
|
|
786
|
+
"g",
|
|
787
|
+
"line",
|
|
788
|
+
"marker",
|
|
789
|
+
"mask",
|
|
790
|
+
"path",
|
|
791
|
+
"polygon",
|
|
792
|
+
"polyline",
|
|
793
|
+
"rect",
|
|
794
|
+
"svg",
|
|
795
|
+
"symbol",
|
|
796
|
+
"text",
|
|
797
|
+
"textPath",
|
|
798
|
+
"tref",
|
|
799
|
+
"tspan",
|
|
800
|
+
"use",
|
|
801
|
+
"animate",
|
|
802
|
+
"animateColor",
|
|
803
|
+
"animateMotion",
|
|
804
|
+
"animateTransform",
|
|
805
|
+
"set"
|
|
806
|
+
],
|
|
807
|
+
focusable: ["svg"],
|
|
808
|
+
imageSizes: ["link"],
|
|
809
|
+
imageSrcSet: ["link"],
|
|
810
|
+
loop: ["audio", "video"],
|
|
811
|
+
mozAllowFullScreen: ["iframe", "video"],
|
|
812
|
+
muted: ["audio", "video"],
|
|
813
|
+
noModule: ["script"],
|
|
814
|
+
onAbort: ["audio", "video"],
|
|
815
|
+
onCanPlay: ["audio", "video"],
|
|
816
|
+
onCanPlayThrough: ["audio", "video"],
|
|
817
|
+
onCancel: ["dialog"],
|
|
818
|
+
onClose: ["dialog"],
|
|
819
|
+
onDurationChange: ["audio", "video"],
|
|
820
|
+
onEmptied: ["audio", "video"],
|
|
821
|
+
onEncrypted: ["audio", "video"],
|
|
822
|
+
onEnded: ["audio", "video"],
|
|
823
|
+
onError: [
|
|
824
|
+
"audio",
|
|
825
|
+
"video",
|
|
826
|
+
"img",
|
|
827
|
+
"link",
|
|
828
|
+
"source",
|
|
829
|
+
"script",
|
|
830
|
+
"picture",
|
|
831
|
+
"iframe"
|
|
832
|
+
],
|
|
833
|
+
onLoad: [
|
|
834
|
+
"script",
|
|
835
|
+
"img",
|
|
836
|
+
"link",
|
|
837
|
+
"picture",
|
|
838
|
+
"iframe",
|
|
839
|
+
"object",
|
|
840
|
+
"source"
|
|
841
|
+
],
|
|
842
|
+
onLoadStart: ["audio", "video"],
|
|
843
|
+
onLoadedData: ["audio", "video"],
|
|
844
|
+
onLoadedMetadata: ["audio", "video"],
|
|
845
|
+
onPause: ["audio", "video"],
|
|
846
|
+
onPlay: ["audio", "video"],
|
|
847
|
+
onPlaying: ["audio", "video"],
|
|
848
|
+
onProgress: ["audio", "video"],
|
|
849
|
+
onRateChange: ["audio", "video"],
|
|
850
|
+
onResize: ["audio", "video"],
|
|
851
|
+
onSeeked: ["audio", "video"],
|
|
852
|
+
onSeeking: ["audio", "video"],
|
|
853
|
+
onStalled: ["audio", "video"],
|
|
854
|
+
onSuspend: ["audio", "video"],
|
|
855
|
+
onTimeUpdate: ["audio", "video"],
|
|
856
|
+
onVolumeChange: ["audio", "video"],
|
|
857
|
+
onWaiting: ["audio", "video"],
|
|
858
|
+
playsInline: ["video"],
|
|
859
|
+
poster: ["video"],
|
|
860
|
+
preload: ["audio", "video"],
|
|
861
|
+
property: ["meta"],
|
|
862
|
+
returnValue: ["dialog"],
|
|
863
|
+
scrolling: ["iframe"],
|
|
864
|
+
valign: [
|
|
865
|
+
"tr",
|
|
866
|
+
"td",
|
|
867
|
+
"th",
|
|
868
|
+
"thead",
|
|
869
|
+
"tbody",
|
|
870
|
+
"tfoot",
|
|
871
|
+
"colgroup",
|
|
872
|
+
"col"
|
|
873
|
+
],
|
|
874
|
+
viewBox: [
|
|
875
|
+
"marker",
|
|
876
|
+
"pattern",
|
|
877
|
+
"svg",
|
|
878
|
+
"symbol",
|
|
879
|
+
"view"
|
|
880
|
+
],
|
|
881
|
+
webkitAllowFullScreen: ["iframe", "video"],
|
|
882
|
+
webkitDirectory: ["input"]
|
|
898
883
|
};
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
"ref",
|
|
1094
|
-
"key",
|
|
1095
|
-
"children",
|
|
1096
|
-
// Non-standard
|
|
1097
|
-
"results",
|
|
1098
|
-
"security",
|
|
1099
|
-
// Video specific
|
|
1100
|
-
"controls"
|
|
884
|
+
/**
|
|
885
|
+
* Single-word HTML/DOM properties
|
|
886
|
+
*/
|
|
887
|
+
const DOM_PROPERTY_NAMES_ONE_WORD = [
|
|
888
|
+
"dir",
|
|
889
|
+
"draggable",
|
|
890
|
+
"hidden",
|
|
891
|
+
"id",
|
|
892
|
+
"lang",
|
|
893
|
+
"nonce",
|
|
894
|
+
"part",
|
|
895
|
+
"slot",
|
|
896
|
+
"style",
|
|
897
|
+
"title",
|
|
898
|
+
"translate",
|
|
899
|
+
"inert",
|
|
900
|
+
"accept",
|
|
901
|
+
"action",
|
|
902
|
+
"allow",
|
|
903
|
+
"alt",
|
|
904
|
+
"as",
|
|
905
|
+
"async",
|
|
906
|
+
"buffered",
|
|
907
|
+
"capture",
|
|
908
|
+
"challenge",
|
|
909
|
+
"cite",
|
|
910
|
+
"code",
|
|
911
|
+
"cols",
|
|
912
|
+
"content",
|
|
913
|
+
"coords",
|
|
914
|
+
"csp",
|
|
915
|
+
"data",
|
|
916
|
+
"decoding",
|
|
917
|
+
"default",
|
|
918
|
+
"defer",
|
|
919
|
+
"disabled",
|
|
920
|
+
"form",
|
|
921
|
+
"headers",
|
|
922
|
+
"height",
|
|
923
|
+
"high",
|
|
924
|
+
"href",
|
|
925
|
+
"icon",
|
|
926
|
+
"importance",
|
|
927
|
+
"integrity",
|
|
928
|
+
"kind",
|
|
929
|
+
"label",
|
|
930
|
+
"language",
|
|
931
|
+
"loading",
|
|
932
|
+
"list",
|
|
933
|
+
"loop",
|
|
934
|
+
"low",
|
|
935
|
+
"manifest",
|
|
936
|
+
"max",
|
|
937
|
+
"media",
|
|
938
|
+
"method",
|
|
939
|
+
"min",
|
|
940
|
+
"multiple",
|
|
941
|
+
"muted",
|
|
942
|
+
"name",
|
|
943
|
+
"open",
|
|
944
|
+
"optimum",
|
|
945
|
+
"pattern",
|
|
946
|
+
"ping",
|
|
947
|
+
"placeholder",
|
|
948
|
+
"poster",
|
|
949
|
+
"preload",
|
|
950
|
+
"profile",
|
|
951
|
+
"rel",
|
|
952
|
+
"required",
|
|
953
|
+
"reversed",
|
|
954
|
+
"role",
|
|
955
|
+
"rows",
|
|
956
|
+
"sandbox",
|
|
957
|
+
"scope",
|
|
958
|
+
"seamless",
|
|
959
|
+
"selected",
|
|
960
|
+
"shape",
|
|
961
|
+
"size",
|
|
962
|
+
"sizes",
|
|
963
|
+
"span",
|
|
964
|
+
"src",
|
|
965
|
+
"start",
|
|
966
|
+
"step",
|
|
967
|
+
"summary",
|
|
968
|
+
"target",
|
|
969
|
+
"type",
|
|
970
|
+
"value",
|
|
971
|
+
"width",
|
|
972
|
+
"wmode",
|
|
973
|
+
"wrap",
|
|
974
|
+
"accumulate",
|
|
975
|
+
"additive",
|
|
976
|
+
"alphabetic",
|
|
977
|
+
"amplitude",
|
|
978
|
+
"ascent",
|
|
979
|
+
"azimuth",
|
|
980
|
+
"bbox",
|
|
981
|
+
"begin",
|
|
982
|
+
"bias",
|
|
983
|
+
"by",
|
|
984
|
+
"clip",
|
|
985
|
+
"color",
|
|
986
|
+
"cursor",
|
|
987
|
+
"cx",
|
|
988
|
+
"cy",
|
|
989
|
+
"d",
|
|
990
|
+
"decelerate",
|
|
991
|
+
"descent",
|
|
992
|
+
"direction",
|
|
993
|
+
"display",
|
|
994
|
+
"divisor",
|
|
995
|
+
"dur",
|
|
996
|
+
"dx",
|
|
997
|
+
"dy",
|
|
998
|
+
"elevation",
|
|
999
|
+
"end",
|
|
1000
|
+
"exponent",
|
|
1001
|
+
"fill",
|
|
1002
|
+
"filter",
|
|
1003
|
+
"format",
|
|
1004
|
+
"from",
|
|
1005
|
+
"fr",
|
|
1006
|
+
"fx",
|
|
1007
|
+
"fy",
|
|
1008
|
+
"g1",
|
|
1009
|
+
"g2",
|
|
1010
|
+
"hanging",
|
|
1011
|
+
"height",
|
|
1012
|
+
"hreflang",
|
|
1013
|
+
"ideographic",
|
|
1014
|
+
"in",
|
|
1015
|
+
"in2",
|
|
1016
|
+
"intercept",
|
|
1017
|
+
"k",
|
|
1018
|
+
"k1",
|
|
1019
|
+
"k2",
|
|
1020
|
+
"k3",
|
|
1021
|
+
"k4",
|
|
1022
|
+
"kerning",
|
|
1023
|
+
"local",
|
|
1024
|
+
"mask",
|
|
1025
|
+
"mode",
|
|
1026
|
+
"offset",
|
|
1027
|
+
"opacity",
|
|
1028
|
+
"operator",
|
|
1029
|
+
"order",
|
|
1030
|
+
"orient",
|
|
1031
|
+
"orientation",
|
|
1032
|
+
"origin",
|
|
1033
|
+
"overflow",
|
|
1034
|
+
"path",
|
|
1035
|
+
"ping",
|
|
1036
|
+
"points",
|
|
1037
|
+
"r",
|
|
1038
|
+
"radius",
|
|
1039
|
+
"rel",
|
|
1040
|
+
"restart",
|
|
1041
|
+
"result",
|
|
1042
|
+
"rotate",
|
|
1043
|
+
"rx",
|
|
1044
|
+
"ry",
|
|
1045
|
+
"scale",
|
|
1046
|
+
"seed",
|
|
1047
|
+
"slope",
|
|
1048
|
+
"spacing",
|
|
1049
|
+
"speed",
|
|
1050
|
+
"stemh",
|
|
1051
|
+
"stemv",
|
|
1052
|
+
"string",
|
|
1053
|
+
"stroke",
|
|
1054
|
+
"to",
|
|
1055
|
+
"transform",
|
|
1056
|
+
"u1",
|
|
1057
|
+
"u2",
|
|
1058
|
+
"unicode",
|
|
1059
|
+
"values",
|
|
1060
|
+
"version",
|
|
1061
|
+
"visibility",
|
|
1062
|
+
"widths",
|
|
1063
|
+
"x",
|
|
1064
|
+
"x1",
|
|
1065
|
+
"x2",
|
|
1066
|
+
"xmlns",
|
|
1067
|
+
"y",
|
|
1068
|
+
"y1",
|
|
1069
|
+
"y2",
|
|
1070
|
+
"z",
|
|
1071
|
+
"property",
|
|
1072
|
+
"ref",
|
|
1073
|
+
"key",
|
|
1074
|
+
"children",
|
|
1075
|
+
"results",
|
|
1076
|
+
"security",
|
|
1077
|
+
"controls"
|
|
1101
1078
|
];
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
"onMouseDownCapture",
|
|
1466
|
-
"onMouseMoveCapture",
|
|
1467
|
-
"onMouseOutCapture",
|
|
1468
|
-
"onMouseOverCapture",
|
|
1469
|
-
"onMouseUpCapture",
|
|
1470
|
-
// Video specific
|
|
1471
|
-
"autoPictureInPicture",
|
|
1472
|
-
"controlsList",
|
|
1473
|
-
"disablePictureInPicture",
|
|
1474
|
-
"disableRemotePlayback"
|
|
1079
|
+
/**
|
|
1080
|
+
* Multi-word (camelCase) HTML/DOM properties
|
|
1081
|
+
*/
|
|
1082
|
+
const DOM_PROPERTY_NAMES_TWO_WORDS = [
|
|
1083
|
+
"accessKey",
|
|
1084
|
+
"autoCapitalize",
|
|
1085
|
+
"autoFocus",
|
|
1086
|
+
"contentEditable",
|
|
1087
|
+
"enterKeyHint",
|
|
1088
|
+
"exportParts",
|
|
1089
|
+
"inputMode",
|
|
1090
|
+
"itemID",
|
|
1091
|
+
"itemRef",
|
|
1092
|
+
"itemProp",
|
|
1093
|
+
"itemScope",
|
|
1094
|
+
"itemType",
|
|
1095
|
+
"spellCheck",
|
|
1096
|
+
"tabIndex",
|
|
1097
|
+
"acceptCharset",
|
|
1098
|
+
"autoComplete",
|
|
1099
|
+
"autoPlay",
|
|
1100
|
+
"border",
|
|
1101
|
+
"cellPadding",
|
|
1102
|
+
"cellSpacing",
|
|
1103
|
+
"classID",
|
|
1104
|
+
"codeBase",
|
|
1105
|
+
"colSpan",
|
|
1106
|
+
"contextMenu",
|
|
1107
|
+
"dateTime",
|
|
1108
|
+
"encType",
|
|
1109
|
+
"formAction",
|
|
1110
|
+
"formEncType",
|
|
1111
|
+
"formMethod",
|
|
1112
|
+
"formNoValidate",
|
|
1113
|
+
"formTarget",
|
|
1114
|
+
"frameBorder",
|
|
1115
|
+
"hrefLang",
|
|
1116
|
+
"httpEquiv",
|
|
1117
|
+
"imageSizes",
|
|
1118
|
+
"imageSrcSet",
|
|
1119
|
+
"isMap",
|
|
1120
|
+
"keyParams",
|
|
1121
|
+
"keyType",
|
|
1122
|
+
"marginHeight",
|
|
1123
|
+
"marginWidth",
|
|
1124
|
+
"maxLength",
|
|
1125
|
+
"mediaGroup",
|
|
1126
|
+
"minLength",
|
|
1127
|
+
"noValidate",
|
|
1128
|
+
"onAnimationEnd",
|
|
1129
|
+
"onAnimationIteration",
|
|
1130
|
+
"onAnimationStart",
|
|
1131
|
+
"onBlur",
|
|
1132
|
+
"onChange",
|
|
1133
|
+
"onClick",
|
|
1134
|
+
"onContextMenu",
|
|
1135
|
+
"onCopy",
|
|
1136
|
+
"onCompositionEnd",
|
|
1137
|
+
"onCompositionStart",
|
|
1138
|
+
"onCompositionUpdate",
|
|
1139
|
+
"onCut",
|
|
1140
|
+
"onDoubleClick",
|
|
1141
|
+
"onDrag",
|
|
1142
|
+
"onDragEnd",
|
|
1143
|
+
"onDragEnter",
|
|
1144
|
+
"onDragExit",
|
|
1145
|
+
"onDragLeave",
|
|
1146
|
+
"onError",
|
|
1147
|
+
"onFocus",
|
|
1148
|
+
"onInput",
|
|
1149
|
+
"onKeyDown",
|
|
1150
|
+
"onKeyPress",
|
|
1151
|
+
"onKeyUp",
|
|
1152
|
+
"onLoad",
|
|
1153
|
+
"onWheel",
|
|
1154
|
+
"onDragOver",
|
|
1155
|
+
"onDragStart",
|
|
1156
|
+
"onDrop",
|
|
1157
|
+
"onMouseDown",
|
|
1158
|
+
"onMouseEnter",
|
|
1159
|
+
"onMouseLeave",
|
|
1160
|
+
"onMouseMove",
|
|
1161
|
+
"onMouseOut",
|
|
1162
|
+
"onMouseOver",
|
|
1163
|
+
"onMouseUp",
|
|
1164
|
+
"onPaste",
|
|
1165
|
+
"onScroll",
|
|
1166
|
+
"onSelect",
|
|
1167
|
+
"onSubmit",
|
|
1168
|
+
"onToggle",
|
|
1169
|
+
"onTransitionEnd",
|
|
1170
|
+
"radioGroup",
|
|
1171
|
+
"readOnly",
|
|
1172
|
+
"referrerPolicy",
|
|
1173
|
+
"rowSpan",
|
|
1174
|
+
"srcDoc",
|
|
1175
|
+
"srcLang",
|
|
1176
|
+
"srcSet",
|
|
1177
|
+
"useMap",
|
|
1178
|
+
"fetchPriority",
|
|
1179
|
+
"crossOrigin",
|
|
1180
|
+
"accentHeight",
|
|
1181
|
+
"alignmentBaseline",
|
|
1182
|
+
"arabicForm",
|
|
1183
|
+
"attributeName",
|
|
1184
|
+
"attributeType",
|
|
1185
|
+
"baseFrequency",
|
|
1186
|
+
"baselineShift",
|
|
1187
|
+
"baseProfile",
|
|
1188
|
+
"calcMode",
|
|
1189
|
+
"capHeight",
|
|
1190
|
+
"clipPathUnits",
|
|
1191
|
+
"clipPath",
|
|
1192
|
+
"clipRule",
|
|
1193
|
+
"colorInterpolation",
|
|
1194
|
+
"colorInterpolationFilters",
|
|
1195
|
+
"colorProfile",
|
|
1196
|
+
"colorRendering",
|
|
1197
|
+
"contentScriptType",
|
|
1198
|
+
"contentStyleType",
|
|
1199
|
+
"diffuseConstant",
|
|
1200
|
+
"dominantBaseline",
|
|
1201
|
+
"edgeMode",
|
|
1202
|
+
"enableBackground",
|
|
1203
|
+
"fillOpacity",
|
|
1204
|
+
"fillRule",
|
|
1205
|
+
"filterRes",
|
|
1206
|
+
"filterUnits",
|
|
1207
|
+
"floodColor",
|
|
1208
|
+
"floodOpacity",
|
|
1209
|
+
"fontFamily",
|
|
1210
|
+
"fontSize",
|
|
1211
|
+
"fontSizeAdjust",
|
|
1212
|
+
"fontStretch",
|
|
1213
|
+
"fontStyle",
|
|
1214
|
+
"fontVariant",
|
|
1215
|
+
"fontWeight",
|
|
1216
|
+
"glyphName",
|
|
1217
|
+
"glyphOrientationHorizontal",
|
|
1218
|
+
"glyphOrientationVertical",
|
|
1219
|
+
"glyphRef",
|
|
1220
|
+
"gradientTransform",
|
|
1221
|
+
"gradientUnits",
|
|
1222
|
+
"horizAdvX",
|
|
1223
|
+
"horizOriginX",
|
|
1224
|
+
"imageRendering",
|
|
1225
|
+
"kernelMatrix",
|
|
1226
|
+
"kernelUnitLength",
|
|
1227
|
+
"keyPoints",
|
|
1228
|
+
"keySplines",
|
|
1229
|
+
"keyTimes",
|
|
1230
|
+
"lengthAdjust",
|
|
1231
|
+
"letterSpacing",
|
|
1232
|
+
"lightingColor",
|
|
1233
|
+
"limitingConeAngle",
|
|
1234
|
+
"markerEnd",
|
|
1235
|
+
"markerMid",
|
|
1236
|
+
"markerStart",
|
|
1237
|
+
"markerHeight",
|
|
1238
|
+
"markerUnits",
|
|
1239
|
+
"markerWidth",
|
|
1240
|
+
"maskContentUnits",
|
|
1241
|
+
"maskUnits",
|
|
1242
|
+
"mathematical",
|
|
1243
|
+
"numOctaves",
|
|
1244
|
+
"overlinePosition",
|
|
1245
|
+
"overlineThickness",
|
|
1246
|
+
"panose1",
|
|
1247
|
+
"paintOrder",
|
|
1248
|
+
"pathLength",
|
|
1249
|
+
"patternContentUnits",
|
|
1250
|
+
"patternTransform",
|
|
1251
|
+
"patternUnits",
|
|
1252
|
+
"pointerEvents",
|
|
1253
|
+
"pointsAtX",
|
|
1254
|
+
"pointsAtY",
|
|
1255
|
+
"pointsAtZ",
|
|
1256
|
+
"preserveAlpha",
|
|
1257
|
+
"preserveAspectRatio",
|
|
1258
|
+
"primitiveUnits",
|
|
1259
|
+
"referrerPolicy",
|
|
1260
|
+
"refX",
|
|
1261
|
+
"refY",
|
|
1262
|
+
"rendering-intent",
|
|
1263
|
+
"repeatCount",
|
|
1264
|
+
"repeatDur",
|
|
1265
|
+
"requiredExtensions",
|
|
1266
|
+
"requiredFeatures",
|
|
1267
|
+
"shapeRendering",
|
|
1268
|
+
"specularConstant",
|
|
1269
|
+
"specularExponent",
|
|
1270
|
+
"spreadMethod",
|
|
1271
|
+
"startOffset",
|
|
1272
|
+
"stdDeviation",
|
|
1273
|
+
"stitchTiles",
|
|
1274
|
+
"stopColor",
|
|
1275
|
+
"stopOpacity",
|
|
1276
|
+
"strikethroughPosition",
|
|
1277
|
+
"strikethroughThickness",
|
|
1278
|
+
"strokeDasharray",
|
|
1279
|
+
"strokeDashoffset",
|
|
1280
|
+
"strokeLinecap",
|
|
1281
|
+
"strokeLinejoin",
|
|
1282
|
+
"strokeMiterlimit",
|
|
1283
|
+
"strokeOpacity",
|
|
1284
|
+
"strokeWidth",
|
|
1285
|
+
"surfaceScale",
|
|
1286
|
+
"systemLanguage",
|
|
1287
|
+
"tableValues",
|
|
1288
|
+
"targetX",
|
|
1289
|
+
"targetY",
|
|
1290
|
+
"textAnchor",
|
|
1291
|
+
"textDecoration",
|
|
1292
|
+
"textRendering",
|
|
1293
|
+
"textLength",
|
|
1294
|
+
"transformOrigin",
|
|
1295
|
+
"underlinePosition",
|
|
1296
|
+
"underlineThickness",
|
|
1297
|
+
"unicodeBidi",
|
|
1298
|
+
"unicodeRange",
|
|
1299
|
+
"unitsPerEm",
|
|
1300
|
+
"vAlphabetic",
|
|
1301
|
+
"vHanging",
|
|
1302
|
+
"vIdeographic",
|
|
1303
|
+
"vMathematical",
|
|
1304
|
+
"vectorEffect",
|
|
1305
|
+
"vertAdvY",
|
|
1306
|
+
"vertOriginX",
|
|
1307
|
+
"vertOriginY",
|
|
1308
|
+
"viewBox",
|
|
1309
|
+
"viewTarget",
|
|
1310
|
+
"wordSpacing",
|
|
1311
|
+
"writingMode",
|
|
1312
|
+
"xHeight",
|
|
1313
|
+
"xChannelSelector",
|
|
1314
|
+
"xlinkActuate",
|
|
1315
|
+
"xlinkArcrole",
|
|
1316
|
+
"xlinkHref",
|
|
1317
|
+
"xlinkRole",
|
|
1318
|
+
"xlinkShow",
|
|
1319
|
+
"xlinkTitle",
|
|
1320
|
+
"xlinkType",
|
|
1321
|
+
"xmlBase",
|
|
1322
|
+
"xmlLang",
|
|
1323
|
+
"xmlnsXlink",
|
|
1324
|
+
"xmlSpace",
|
|
1325
|
+
"yChannelSelector",
|
|
1326
|
+
"zoomAndPan",
|
|
1327
|
+
"autoCorrect",
|
|
1328
|
+
"autoSave",
|
|
1329
|
+
"className",
|
|
1330
|
+
"dangerouslySetInnerHTML",
|
|
1331
|
+
"defaultValue",
|
|
1332
|
+
"defaultChecked",
|
|
1333
|
+
"htmlFor",
|
|
1334
|
+
"onBeforeInput",
|
|
1335
|
+
"onChange",
|
|
1336
|
+
"onInvalid",
|
|
1337
|
+
"onReset",
|
|
1338
|
+
"onTouchCancel",
|
|
1339
|
+
"onTouchEnd",
|
|
1340
|
+
"onTouchMove",
|
|
1341
|
+
"onTouchStart",
|
|
1342
|
+
"suppressContentEditableWarning",
|
|
1343
|
+
"suppressHydrationWarning",
|
|
1344
|
+
"onAbort",
|
|
1345
|
+
"onCanPlay",
|
|
1346
|
+
"onCanPlayThrough",
|
|
1347
|
+
"onDurationChange",
|
|
1348
|
+
"onEmptied",
|
|
1349
|
+
"onEncrypted",
|
|
1350
|
+
"onEnded",
|
|
1351
|
+
"onLoadedData",
|
|
1352
|
+
"onLoadedMetadata",
|
|
1353
|
+
"onLoadStart",
|
|
1354
|
+
"onPause",
|
|
1355
|
+
"onPlay",
|
|
1356
|
+
"onPlaying",
|
|
1357
|
+
"onProgress",
|
|
1358
|
+
"onRateChange",
|
|
1359
|
+
"onResize",
|
|
1360
|
+
"onSeeked",
|
|
1361
|
+
"onSeeking",
|
|
1362
|
+
"onStalled",
|
|
1363
|
+
"onSuspend",
|
|
1364
|
+
"onTimeUpdate",
|
|
1365
|
+
"onVolumeChange",
|
|
1366
|
+
"onWaiting",
|
|
1367
|
+
"onCopyCapture",
|
|
1368
|
+
"onCutCapture",
|
|
1369
|
+
"onPasteCapture",
|
|
1370
|
+
"onCompositionEndCapture",
|
|
1371
|
+
"onCompositionStartCapture",
|
|
1372
|
+
"onCompositionUpdateCapture",
|
|
1373
|
+
"onFocusCapture",
|
|
1374
|
+
"onBlurCapture",
|
|
1375
|
+
"onChangeCapture",
|
|
1376
|
+
"onBeforeInputCapture",
|
|
1377
|
+
"onInputCapture",
|
|
1378
|
+
"onResetCapture",
|
|
1379
|
+
"onSubmitCapture",
|
|
1380
|
+
"onInvalidCapture",
|
|
1381
|
+
"onLoadCapture",
|
|
1382
|
+
"onErrorCapture",
|
|
1383
|
+
"onKeyDownCapture",
|
|
1384
|
+
"onKeyPressCapture",
|
|
1385
|
+
"onKeyUpCapture",
|
|
1386
|
+
"onAbortCapture",
|
|
1387
|
+
"onCanPlayCapture",
|
|
1388
|
+
"onCanPlayThroughCapture",
|
|
1389
|
+
"onDurationChangeCapture",
|
|
1390
|
+
"onEmptiedCapture",
|
|
1391
|
+
"onEncryptedCapture",
|
|
1392
|
+
"onEndedCapture",
|
|
1393
|
+
"onLoadedDataCapture",
|
|
1394
|
+
"onLoadedMetadataCapture",
|
|
1395
|
+
"onLoadStartCapture",
|
|
1396
|
+
"onPauseCapture",
|
|
1397
|
+
"onPlayCapture",
|
|
1398
|
+
"onPlayingCapture",
|
|
1399
|
+
"onProgressCapture",
|
|
1400
|
+
"onRateChangeCapture",
|
|
1401
|
+
"onSeekedCapture",
|
|
1402
|
+
"onSeekingCapture",
|
|
1403
|
+
"onStalledCapture",
|
|
1404
|
+
"onSuspendCapture",
|
|
1405
|
+
"onTimeUpdateCapture",
|
|
1406
|
+
"onVolumeChangeCapture",
|
|
1407
|
+
"onWaitingCapture",
|
|
1408
|
+
"onSelectCapture",
|
|
1409
|
+
"onTouchCancelCapture",
|
|
1410
|
+
"onTouchEndCapture",
|
|
1411
|
+
"onTouchMoveCapture",
|
|
1412
|
+
"onTouchStartCapture",
|
|
1413
|
+
"onScrollCapture",
|
|
1414
|
+
"onWheelCapture",
|
|
1415
|
+
"onAnimationEndCapture",
|
|
1416
|
+
"onAnimationIteration",
|
|
1417
|
+
"onAnimationStartCapture",
|
|
1418
|
+
"onTransitionEndCapture",
|
|
1419
|
+
"onAuxClick",
|
|
1420
|
+
"onAuxClickCapture",
|
|
1421
|
+
"onClickCapture",
|
|
1422
|
+
"onContextMenuCapture",
|
|
1423
|
+
"onDoubleClickCapture",
|
|
1424
|
+
"onDragCapture",
|
|
1425
|
+
"onDragEndCapture",
|
|
1426
|
+
"onDragEnterCapture",
|
|
1427
|
+
"onDragExitCapture",
|
|
1428
|
+
"onDragLeaveCapture",
|
|
1429
|
+
"onDragOverCapture",
|
|
1430
|
+
"onDragStartCapture",
|
|
1431
|
+
"onDropCapture",
|
|
1432
|
+
"onMouseDown",
|
|
1433
|
+
"onMouseDownCapture",
|
|
1434
|
+
"onMouseMoveCapture",
|
|
1435
|
+
"onMouseOutCapture",
|
|
1436
|
+
"onMouseOverCapture",
|
|
1437
|
+
"onMouseUpCapture",
|
|
1438
|
+
"autoPictureInPicture",
|
|
1439
|
+
"controlsList",
|
|
1440
|
+
"disablePictureInPicture",
|
|
1441
|
+
"disableRemotePlayback"
|
|
1475
1442
|
];
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1443
|
+
/**
|
|
1444
|
+
* DOM properties that are exempt from case sensitivity checks
|
|
1445
|
+
*/
|
|
1446
|
+
const DOM_PROPERTIES_IGNORE_CASE = [
|
|
1447
|
+
"charset",
|
|
1448
|
+
"allowFullScreen",
|
|
1449
|
+
"webkitAllowFullScreen",
|
|
1450
|
+
"mozAllowFullScreen",
|
|
1451
|
+
"webkitDirectory"
|
|
1482
1452
|
];
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
"aria-setsize"
|
|
1453
|
+
/**
|
|
1454
|
+
* List of ARIA attributes
|
|
1455
|
+
*/
|
|
1456
|
+
const ARIA_PROPERTIES = [
|
|
1457
|
+
"aria-atomic",
|
|
1458
|
+
"aria-braillelabel",
|
|
1459
|
+
"aria-brailleroledescription",
|
|
1460
|
+
"aria-busy",
|
|
1461
|
+
"aria-controls",
|
|
1462
|
+
"aria-current",
|
|
1463
|
+
"aria-describedby",
|
|
1464
|
+
"aria-description",
|
|
1465
|
+
"aria-details",
|
|
1466
|
+
"aria-disabled",
|
|
1467
|
+
"aria-dropeffect",
|
|
1468
|
+
"aria-errormessage",
|
|
1469
|
+
"aria-flowto",
|
|
1470
|
+
"aria-grabbed",
|
|
1471
|
+
"aria-haspopup",
|
|
1472
|
+
"aria-hidden",
|
|
1473
|
+
"aria-invalid",
|
|
1474
|
+
"aria-keyshortcuts",
|
|
1475
|
+
"aria-label",
|
|
1476
|
+
"aria-labelledby",
|
|
1477
|
+
"aria-live",
|
|
1478
|
+
"aria-owns",
|
|
1479
|
+
"aria-relevant",
|
|
1480
|
+
"aria-roledescription",
|
|
1481
|
+
"aria-autocomplete",
|
|
1482
|
+
"aria-checked",
|
|
1483
|
+
"aria-expanded",
|
|
1484
|
+
"aria-level",
|
|
1485
|
+
"aria-modal",
|
|
1486
|
+
"aria-multiline",
|
|
1487
|
+
"aria-multiselectable",
|
|
1488
|
+
"aria-orientation",
|
|
1489
|
+
"aria-placeholder",
|
|
1490
|
+
"aria-pressed",
|
|
1491
|
+
"aria-readonly",
|
|
1492
|
+
"aria-required",
|
|
1493
|
+
"aria-selected",
|
|
1494
|
+
"aria-sort",
|
|
1495
|
+
"aria-valuemax",
|
|
1496
|
+
"aria-valuemin",
|
|
1497
|
+
"aria-valuenow",
|
|
1498
|
+
"aria-valuetext",
|
|
1499
|
+
"aria-activedescendant",
|
|
1500
|
+
"aria-colcount",
|
|
1501
|
+
"aria-colindex",
|
|
1502
|
+
"aria-colindextext",
|
|
1503
|
+
"aria-colspan",
|
|
1504
|
+
"aria-posinset",
|
|
1505
|
+
"aria-rowcount",
|
|
1506
|
+
"aria-rowindex",
|
|
1507
|
+
"aria-rowindextext",
|
|
1508
|
+
"aria-rowspan",
|
|
1509
|
+
"aria-setsize"
|
|
1541
1510
|
];
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1511
|
+
/**
|
|
1512
|
+
* React-specific pointer event handlers added in React 16.4
|
|
1513
|
+
*/
|
|
1514
|
+
const REACT_ON_PROPS = [
|
|
1515
|
+
"onGotPointerCapture",
|
|
1516
|
+
"onGotPointerCaptureCapture",
|
|
1517
|
+
"onLostPointerCapture",
|
|
1518
|
+
"onLostPointerCapture",
|
|
1519
|
+
"onLostPointerCaptureCapture",
|
|
1520
|
+
"onPointerCancel",
|
|
1521
|
+
"onPointerCancelCapture",
|
|
1522
|
+
"onPointerDown",
|
|
1523
|
+
"onPointerDownCapture",
|
|
1524
|
+
"onPointerEnter",
|
|
1525
|
+
"onPointerEnterCapture",
|
|
1526
|
+
"onPointerLeave",
|
|
1527
|
+
"onPointerLeaveCapture",
|
|
1528
|
+
"onPointerMove",
|
|
1529
|
+
"onPointerMoveCapture",
|
|
1530
|
+
"onPointerOut",
|
|
1531
|
+
"onPointerOutCapture",
|
|
1532
|
+
"onPointerOver",
|
|
1533
|
+
"onPointerOverCapture",
|
|
1534
|
+
"onPointerUp",
|
|
1535
|
+
"onPointerUpCapture"
|
|
1564
1536
|
];
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1537
|
+
/**
|
|
1538
|
+
* Popover API properties added in React 19
|
|
1539
|
+
*/
|
|
1540
|
+
const POPOVER_API_PROPS = [
|
|
1541
|
+
"popover",
|
|
1542
|
+
"popoverTarget",
|
|
1543
|
+
"popoverTargetAction",
|
|
1544
|
+
"onToggle",
|
|
1545
|
+
"onBeforeToggle"
|
|
1571
1546
|
];
|
|
1547
|
+
/**
|
|
1548
|
+
* Gets all valid DOM property names based on React version
|
|
1549
|
+
* @param context - ESLint rule context
|
|
1550
|
+
* @returns Array of valid DOM property names
|
|
1551
|
+
*/
|
|
1572
1552
|
function getDOMPropertyNames(context) {
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
testReactVersion(context, ">=", "19.0.0-rc.0") ? ALL_DOM_PROPERTY_NAMES.push(...POPOVER_API_PROPS) : ALL_DOM_PROPERTY_NAMES.push(...POPOVER_API_PROPS.map((prop) => prop.toLowerCase()));
|
|
1582
|
-
return ALL_DOM_PROPERTY_NAMES;
|
|
1553
|
+
const ALL_DOM_PROPERTY_NAMES = DOM_PROPERTY_NAMES_TWO_WORDS.concat(DOM_PROPERTY_NAMES_ONE_WORD);
|
|
1554
|
+
if (testReactVersion(context, "<=", "16.1.0")) {
|
|
1555
|
+
ALL_DOM_PROPERTY_NAMES.push("allowTransparency");
|
|
1556
|
+
return ALL_DOM_PROPERTY_NAMES;
|
|
1557
|
+
}
|
|
1558
|
+
if (testReactVersion(context, ">=", "16.4.0")) ALL_DOM_PROPERTY_NAMES.push(...REACT_ON_PROPS);
|
|
1559
|
+
testReactVersion(context, ">=", "19.0.0-rc.0") ? ALL_DOM_PROPERTY_NAMES.push(...POPOVER_API_PROPS) : ALL_DOM_PROPERTY_NAMES.push(...POPOVER_API_PROPS.map((prop) => prop.toLowerCase()));
|
|
1560
|
+
return ALL_DOM_PROPERTY_NAMES;
|
|
1583
1561
|
}
|
|
1562
|
+
/**
|
|
1563
|
+
* Checks if a node's parent is a JSX tag that is written with lowercase letters,
|
|
1564
|
+
* and is not a custom web component.
|
|
1565
|
+
* @param childNode - JSX element being tested
|
|
1566
|
+
* @returns Whether the node is a valid HTML tag in JSX
|
|
1567
|
+
*/
|
|
1584
1568
|
function isValidHTMLTagInJSX(childNode) {
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
(attrNode) => attrNode.type === "JSXAttribute" && attrNode.name.type === "JSXIdentifier" && attrNode.name.name === "is"
|
|
1589
|
-
);
|
|
1590
|
-
}
|
|
1591
|
-
return false;
|
|
1569
|
+
const tagConvention = /^[a-z][^-]*$/;
|
|
1570
|
+
if (tagConvention.test(childNode.parent.name.name)) return !childNode.parent.attributes.some((attrNode) => attrNode.type === "JSXAttribute" && attrNode.name.type === "JSXIdentifier" && attrNode.name.name === "is");
|
|
1571
|
+
return false;
|
|
1592
1572
|
}
|
|
1593
|
-
|
|
1594
|
-
|
|
1573
|
+
/**
|
|
1574
|
+
* Normalizes attribute names that should be case-insensitive
|
|
1575
|
+
* @param name - Attribute name to normalize
|
|
1576
|
+
* @returns Normalized attribute name
|
|
1577
|
+
*/
|
|
1578
|
+
function normalizeAttributeCase(name$2) {
|
|
1579
|
+
return DOM_PROPERTIES_IGNORE_CASE.find((element) => element.toLowerCase() === name$2.toLowerCase()) || name$2;
|
|
1595
1580
|
}
|
|
1596
|
-
|
|
1597
|
-
|
|
1581
|
+
/**
|
|
1582
|
+
* Checks if an attribute name is a valid data-* attribute
|
|
1583
|
+
* @param name - Attribute name to test
|
|
1584
|
+
* @returns Whether the attribute is a valid data attribute
|
|
1585
|
+
*/
|
|
1586
|
+
function isValidDataAttribute(name$2) {
|
|
1587
|
+
return !/^data-xml/i.test(name$2) && /^data-[^:]*$/.test(name$2);
|
|
1598
1588
|
}
|
|
1599
|
-
|
|
1600
|
-
|
|
1589
|
+
/**
|
|
1590
|
+
* Checks if an attribute name has uppercase characters
|
|
1591
|
+
* @param name - Attribute name to test
|
|
1592
|
+
* @returns Whether the name has uppercase characters
|
|
1593
|
+
*/
|
|
1594
|
+
function hasUpperCaseCharacter(name$2) {
|
|
1595
|
+
return name$2.toLowerCase() !== name$2;
|
|
1601
1596
|
}
|
|
1602
|
-
|
|
1603
|
-
|
|
1597
|
+
/**
|
|
1598
|
+
* Checks if an attribute is a valid ARIA attribute
|
|
1599
|
+
* @param name - Attribute name to test
|
|
1600
|
+
* @returns Whether the attribute is a valid ARIA attribute
|
|
1601
|
+
*/
|
|
1602
|
+
function isValidAriaAttribute(name$2) {
|
|
1603
|
+
return ARIA_PROPERTIES.some((element) => element === name$2);
|
|
1604
1604
|
}
|
|
1605
|
+
/**
|
|
1606
|
+
* Gets the tag name for a JSXAttribute
|
|
1607
|
+
* @param node - JSXAttribute to get tag name from
|
|
1608
|
+
* @returns Tag name or null
|
|
1609
|
+
*/
|
|
1605
1610
|
function getTagName(node) {
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
}
|
|
1609
|
-
return null;
|
|
1611
|
+
if (node?.parent?.name) return node.parent.name.name;
|
|
1612
|
+
return null;
|
|
1610
1613
|
}
|
|
1614
|
+
/**
|
|
1615
|
+
* Checks if the tag name has a dot (member expression)
|
|
1616
|
+
* @param node - JSXAttribute to check
|
|
1617
|
+
* @returns Whether the tag name has a dot
|
|
1618
|
+
*/
|
|
1611
1619
|
function tagNameHasDot(node) {
|
|
1612
|
-
|
|
1620
|
+
return !!(node.parent?.name && node.parent.name.type === "JSXMemberExpression");
|
|
1613
1621
|
}
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1622
|
+
/**
|
|
1623
|
+
* Gets the standard name of an attribute
|
|
1624
|
+
* @param name - Attribute name
|
|
1625
|
+
* @param context - ESLint context
|
|
1626
|
+
* @returns Standard name or undefined
|
|
1627
|
+
*/
|
|
1628
|
+
function getStandardName(name$2, context) {
|
|
1629
|
+
if (has(DOM_ATTRIBUTE_NAMES, name$2)) return DOM_ATTRIBUTE_NAMES[name$2];
|
|
1630
|
+
if (has(SVGDOM_ATTRIBUTE_NAMES, name$2)) return SVGDOM_ATTRIBUTE_NAMES[name$2];
|
|
1631
|
+
const names = getDOMPropertyNames(context);
|
|
1632
|
+
return names.find((element) => element.toLowerCase() === name$2.toLowerCase());
|
|
1623
1633
|
}
|
|
1634
|
+
/**
|
|
1635
|
+
* Checks if an object has a property
|
|
1636
|
+
* @param obj - Object to check
|
|
1637
|
+
* @param key - Key to check for
|
|
1638
|
+
* @returns Whether the object has the property
|
|
1639
|
+
*/
|
|
1624
1640
|
function has(obj, key) {
|
|
1625
|
-
|
|
1641
|
+
return Object.hasOwn(obj, key);
|
|
1626
1642
|
}
|
|
1643
|
+
/**
|
|
1644
|
+
* Gets text of a node
|
|
1645
|
+
* @param context - ESLint context
|
|
1646
|
+
* @param node - Node to get text from
|
|
1647
|
+
* @returns Node's text
|
|
1648
|
+
*/
|
|
1627
1649
|
function getText(context, node) {
|
|
1628
|
-
|
|
1650
|
+
return context.sourceCode.getText(node);
|
|
1629
1651
|
}
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1652
|
+
/**
|
|
1653
|
+
* Tests React version against a comparator
|
|
1654
|
+
* @param context - ESLint context
|
|
1655
|
+
* @param comparator - Comparison operator
|
|
1656
|
+
* @param version - Version to compare against
|
|
1657
|
+
* @returns Comparison result
|
|
1658
|
+
*/
|
|
1659
|
+
function testReactVersion(context, comparator, version$1) {
|
|
1660
|
+
const { version: localVersion } = (0, __eslint_react_shared.getSettingsFromContext)(context);
|
|
1661
|
+
return (0, compare_versions.compare)(localVersion, version$1, comparator);
|
|
1633
1662
|
}
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1663
|
+
const messages = {
|
|
1664
|
+
dataLowercaseRequired: "React does not recognize data-* props with uppercase characters on a DOM element. Found '{{name}}', use '{{lowerCaseName}}' instead",
|
|
1665
|
+
invalidPropOnTag: "Invalid property '{{name}}' found on tag '{{tagName}}', but it is only allowed on: {{allowedTags}}",
|
|
1666
|
+
unknownProp: "Unknown property '{{name}}' found",
|
|
1667
|
+
unknownPropWithStandardName: "Unknown property '{{name}}' found, use '{{standardName}}' instead"
|
|
1639
1668
|
};
|
|
1640
1669
|
var no_unknown_property_default = createRule({
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
},
|
|
1665
|
-
name: RULE_NAME12,
|
|
1666
|
-
create: create12,
|
|
1667
|
-
defaultOptions: []
|
|
1670
|
+
meta: {
|
|
1671
|
+
type: "problem",
|
|
1672
|
+
docs: { description: "Disallow unknown `DOM` property." },
|
|
1673
|
+
fixable: "code",
|
|
1674
|
+
messages,
|
|
1675
|
+
schema: [{
|
|
1676
|
+
type: "object",
|
|
1677
|
+
additionalProperties: false,
|
|
1678
|
+
properties: {
|
|
1679
|
+
ignore: {
|
|
1680
|
+
type: "array",
|
|
1681
|
+
items: { type: "string" }
|
|
1682
|
+
},
|
|
1683
|
+
requireDataLowercase: {
|
|
1684
|
+
type: "boolean",
|
|
1685
|
+
default: false
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
}]
|
|
1689
|
+
},
|
|
1690
|
+
name: RULE_NAME$4,
|
|
1691
|
+
create: create$4,
|
|
1692
|
+
defaultOptions: []
|
|
1668
1693
|
});
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
};
|
|
1694
|
+
/**
|
|
1695
|
+
* Create function for the ESLint rule
|
|
1696
|
+
* @param context - ESLint rule context
|
|
1697
|
+
* @returns Rule listener
|
|
1698
|
+
*/
|
|
1699
|
+
function create$4(context) {
|
|
1700
|
+
const report = __eslint_react_kit.Reporter.make(context);
|
|
1701
|
+
/**
|
|
1702
|
+
* Gets the ignore configuration from rule options
|
|
1703
|
+
* @returns Array of attribute names to ignore
|
|
1704
|
+
*/
|
|
1705
|
+
function getIgnoreConfig() {
|
|
1706
|
+
return context.options[0]?.ignore || DEFAULTS.ignore;
|
|
1707
|
+
}
|
|
1708
|
+
/**
|
|
1709
|
+
* Gets the requireDataLowercase option from rule options
|
|
1710
|
+
* @returns Whether data attributes must be lowercase
|
|
1711
|
+
*/
|
|
1712
|
+
function getRequireDataLowercase() {
|
|
1713
|
+
return context.options[0] && typeof context.options[0].requireDataLowercase !== "undefined" ? !!context.options[0].requireDataLowercase : DEFAULTS.requireDataLowercase;
|
|
1714
|
+
}
|
|
1715
|
+
return { JSXAttribute(node) {
|
|
1716
|
+
const ignoreNames = getIgnoreConfig();
|
|
1717
|
+
const actualName = getText(context, node.name);
|
|
1718
|
+
if (ignoreNames.indexOf(actualName) >= 0) return;
|
|
1719
|
+
const name$2 = normalizeAttributeCase(actualName);
|
|
1720
|
+
if (tagNameHasDot(node)) return;
|
|
1721
|
+
if (isValidDataAttribute(name$2)) {
|
|
1722
|
+
if (getRequireDataLowercase() && hasUpperCaseCharacter(name$2)) report.send({
|
|
1723
|
+
node,
|
|
1724
|
+
messageId: "dataLowercaseRequired",
|
|
1725
|
+
data: {
|
|
1726
|
+
name: actualName,
|
|
1727
|
+
lowerCaseName: actualName.toLowerCase()
|
|
1728
|
+
}
|
|
1729
|
+
});
|
|
1730
|
+
return;
|
|
1731
|
+
}
|
|
1732
|
+
if (isValidAriaAttribute(name$2)) return;
|
|
1733
|
+
const tagName = getTagName(node);
|
|
1734
|
+
if (tagName === "fbt" || tagName === "fbs") return;
|
|
1735
|
+
if (!isValidHTMLTagInJSX(node)) return;
|
|
1736
|
+
const allowedTags = has(ATTRIBUTE_TAGS_MAP, name$2) ? ATTRIBUTE_TAGS_MAP[name$2] : null;
|
|
1737
|
+
if (tagName && allowedTags) {
|
|
1738
|
+
if (allowedTags.indexOf(tagName) === -1) report.send({
|
|
1739
|
+
node,
|
|
1740
|
+
messageId: "invalidPropOnTag",
|
|
1741
|
+
data: {
|
|
1742
|
+
name: actualName,
|
|
1743
|
+
allowedTags: allowedTags.join(", "),
|
|
1744
|
+
tagName
|
|
1745
|
+
}
|
|
1746
|
+
});
|
|
1747
|
+
return;
|
|
1748
|
+
}
|
|
1749
|
+
const standardName = getStandardName(name$2, context);
|
|
1750
|
+
const hasStandardNameButIsNotUsed = !!standardName && standardName !== name$2;
|
|
1751
|
+
const usesStandardName = !!standardName && standardName === name$2;
|
|
1752
|
+
if (usesStandardName) return;
|
|
1753
|
+
if (hasStandardNameButIsNotUsed) {
|
|
1754
|
+
report.send({
|
|
1755
|
+
node,
|
|
1756
|
+
messageId: "unknownPropWithStandardName",
|
|
1757
|
+
data: {
|
|
1758
|
+
name: actualName,
|
|
1759
|
+
standardName
|
|
1760
|
+
},
|
|
1761
|
+
fix(fixer) {
|
|
1762
|
+
return fixer.replaceText(node.name, standardName);
|
|
1763
|
+
}
|
|
1764
|
+
});
|
|
1765
|
+
return;
|
|
1766
|
+
}
|
|
1767
|
+
report.send({
|
|
1768
|
+
node,
|
|
1769
|
+
messageId: "unknownProp",
|
|
1770
|
+
data: { name: actualName }
|
|
1771
|
+
});
|
|
1772
|
+
} };
|
|
1749
1773
|
}
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
];
|
|
1774
|
+
|
|
1775
|
+
//#endregion
|
|
1776
|
+
//#region src/rules/no-unsafe-iframe-sandbox.ts
|
|
1777
|
+
const RULE_NAME$3 = "no-unsafe-iframe-sandbox";
|
|
1778
|
+
const RULE_FEATURES$3 = [];
|
|
1779
|
+
const unsafeSandboxValues = [["allow-scripts", "allow-same-origin"]];
|
|
1755
1780
|
function hasSafeSandbox(value) {
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1781
|
+
if (typeof value !== "string") return false;
|
|
1782
|
+
return !unsafeSandboxValues.some((values) => {
|
|
1783
|
+
return values.every((v) => value.includes(v));
|
|
1784
|
+
});
|
|
1760
1785
|
}
|
|
1761
1786
|
var no_unsafe_iframe_sandbox_default = createRule({
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
create: create13,
|
|
1775
|
-
defaultOptions: []
|
|
1787
|
+
meta: {
|
|
1788
|
+
type: "problem",
|
|
1789
|
+
docs: {
|
|
1790
|
+
description: "Enforces `sandbox` attribute for `iframe` elements is not set to unsafe combinations.",
|
|
1791
|
+
[Symbol.for("rule_features")]: RULE_FEATURES$3
|
|
1792
|
+
},
|
|
1793
|
+
messages: { noUnsafeIframeSandbox: "Unsafe 'sandbox' attribute value on 'iframe' component." },
|
|
1794
|
+
schema: []
|
|
1795
|
+
},
|
|
1796
|
+
name: RULE_NAME$3,
|
|
1797
|
+
create: create$3,
|
|
1798
|
+
defaultOptions: []
|
|
1776
1799
|
});
|
|
1777
|
-
function
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
});
|
|
1802
|
-
return;
|
|
1803
|
-
}
|
|
1804
|
-
}
|
|
1805
|
-
if (customComponentProp?.defaultValue == null) return;
|
|
1806
|
-
if (!hasSafeSandbox(customComponentProp.defaultValue)) {
|
|
1807
|
-
context.report({
|
|
1808
|
-
messageId: "noUnsafeIframeSandbox",
|
|
1809
|
-
node
|
|
1810
|
-
});
|
|
1811
|
-
}
|
|
1812
|
-
}
|
|
1813
|
-
};
|
|
1800
|
+
function create$3(context) {
|
|
1801
|
+
const resolver = createJsxElementResolver(context);
|
|
1802
|
+
return { JSXElement(node) {
|
|
1803
|
+
const { attributes, domElementType } = resolver.resolve(node);
|
|
1804
|
+
if (domElementType !== "iframe") return;
|
|
1805
|
+
const customComponentProp = findCustomComponentProp("sandbox", attributes);
|
|
1806
|
+
const propNameOnJsx = customComponentProp?.name ?? "sandbox";
|
|
1807
|
+
const attributeNode = __eslint_react_core.getAttribute(context, propNameOnJsx, node.openingElement.attributes, context.sourceCode.getScope(node));
|
|
1808
|
+
if (attributeNode != null) {
|
|
1809
|
+
const attributeValue = __eslint_react_core.getAttributeValue(context, attributeNode, propNameOnJsx);
|
|
1810
|
+
if (attributeValue.kind === "some" && !hasSafeSandbox(attributeValue.value)) {
|
|
1811
|
+
context.report({
|
|
1812
|
+
messageId: "noUnsafeIframeSandbox",
|
|
1813
|
+
node: attributeNode
|
|
1814
|
+
});
|
|
1815
|
+
return;
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
if (customComponentProp?.defaultValue == null) return;
|
|
1819
|
+
if (!hasSafeSandbox(customComponentProp.defaultValue)) context.report({
|
|
1820
|
+
messageId: "noUnsafeIframeSandbox",
|
|
1821
|
+
node
|
|
1822
|
+
});
|
|
1823
|
+
} };
|
|
1814
1824
|
}
|
|
1815
|
-
|
|
1816
|
-
|
|
1825
|
+
|
|
1826
|
+
//#endregion
|
|
1827
|
+
//#region src/rules/no-unsafe-target-blank.ts
|
|
1828
|
+
const RULE_NAME$2 = "no-unsafe-target-blank";
|
|
1829
|
+
const RULE_FEATURES$2 = [];
|
|
1817
1830
|
function isExternalLinkLike(value) {
|
|
1818
|
-
|
|
1819
|
-
|
|
1831
|
+
if (value == null) return false;
|
|
1832
|
+
return value.startsWith("https://") || /^(?:\w+:|\/\/)/u.test(value);
|
|
1820
1833
|
}
|
|
1821
1834
|
function isSafeRel(value) {
|
|
1822
|
-
|
|
1823
|
-
|
|
1835
|
+
if (value == null) return false;
|
|
1836
|
+
return value === "noreferrer" || /\bnoreferrer\b/u.test(value);
|
|
1824
1837
|
}
|
|
1825
1838
|
var no_unsafe_target_blank_default = createRule({
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
create: create14,
|
|
1839
|
-
defaultOptions: []
|
|
1839
|
+
meta: {
|
|
1840
|
+
type: "problem",
|
|
1841
|
+
docs: {
|
|
1842
|
+
description: "Disallow `target=\"_blank\"` without `rel=\"noreferrer noopener\"`.",
|
|
1843
|
+
[Symbol.for("rule_features")]: RULE_FEATURES$2
|
|
1844
|
+
},
|
|
1845
|
+
messages: { noUnsafeTargetBlank: `Using 'target="_blank"' on an external link without 'rel="noreferrer noopener"' is a security risk.` },
|
|
1846
|
+
schema: []
|
|
1847
|
+
},
|
|
1848
|
+
name: RULE_NAME$2,
|
|
1849
|
+
create: create$2,
|
|
1850
|
+
defaultOptions: []
|
|
1840
1851
|
});
|
|
1841
|
-
function
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
if (getAttributeStringValue("target") !== "_blank") {
|
|
1865
|
-
return;
|
|
1866
|
-
}
|
|
1867
|
-
if (!isExternalLinkLike(getAttributeStringValue("href"))) {
|
|
1868
|
-
return;
|
|
1869
|
-
}
|
|
1870
|
-
if (isSafeRel(getAttributeStringValue("rel"))) {
|
|
1871
|
-
return;
|
|
1872
|
-
}
|
|
1873
|
-
context.report({
|
|
1874
|
-
messageId: "noUnsafeTargetBlank",
|
|
1875
|
-
node
|
|
1876
|
-
});
|
|
1877
|
-
}
|
|
1878
|
-
};
|
|
1852
|
+
function create$2(context) {
|
|
1853
|
+
const resolver = createJsxElementResolver(context);
|
|
1854
|
+
return { JSXElement(node) {
|
|
1855
|
+
const { attributes, domElementType } = resolver.resolve(node);
|
|
1856
|
+
if (domElementType !== "a") return;
|
|
1857
|
+
const elementScope = context.sourceCode.getScope(node);
|
|
1858
|
+
const getAttributeStringValue = (name$2) => {
|
|
1859
|
+
const customComponentProp = findCustomComponentProp(name$2, attributes);
|
|
1860
|
+
const propNameOnJsx = customComponentProp?.name ?? name$2;
|
|
1861
|
+
const attributeNode = __eslint_react_core.getAttribute(context, propNameOnJsx, node.openingElement.attributes, elementScope);
|
|
1862
|
+
if (attributeNode == null) return customComponentProp?.defaultValue;
|
|
1863
|
+
const attributeValue = __eslint_react_core.getAttributeValue(context, attributeNode, propNameOnJsx);
|
|
1864
|
+
if (attributeValue.kind === "some" && typeof attributeValue.value === "string") return attributeValue.value;
|
|
1865
|
+
return __eslint_react_eff.unit;
|
|
1866
|
+
};
|
|
1867
|
+
if (getAttributeStringValue("target") !== "_blank") return;
|
|
1868
|
+
if (!isExternalLinkLike(getAttributeStringValue("href"))) return;
|
|
1869
|
+
if (isSafeRel(getAttributeStringValue("rel"))) return;
|
|
1870
|
+
context.report({
|
|
1871
|
+
messageId: "noUnsafeTargetBlank",
|
|
1872
|
+
node
|
|
1873
|
+
});
|
|
1874
|
+
} };
|
|
1879
1875
|
}
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1876
|
+
|
|
1877
|
+
//#endregion
|
|
1878
|
+
//#region src/rules/no-use-form-state.ts
|
|
1879
|
+
const RULE_NAME$1 = "no-use-form-state";
|
|
1880
|
+
const RULE_FEATURES$1 = ["MOD"];
|
|
1884
1881
|
var no_use_form_state_default = createRule({
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
create: create15,
|
|
1899
|
-
defaultOptions: []
|
|
1882
|
+
meta: {
|
|
1883
|
+
type: "problem",
|
|
1884
|
+
docs: {
|
|
1885
|
+
description: "Replaces usages of `useFormState` with `useActionState`.",
|
|
1886
|
+
[Symbol.for("rule_features")]: RULE_FEATURES$1
|
|
1887
|
+
},
|
|
1888
|
+
fixable: "code",
|
|
1889
|
+
messages: { noUseFormState: "[Deprecated] Use 'useActionState' from 'react' package instead." },
|
|
1890
|
+
schema: []
|
|
1891
|
+
},
|
|
1892
|
+
name: RULE_NAME$1,
|
|
1893
|
+
create: create$1,
|
|
1894
|
+
defaultOptions: []
|
|
1900
1895
|
});
|
|
1901
|
-
function
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
}
|
|
1942
|
-
}
|
|
1943
|
-
}
|
|
1944
|
-
};
|
|
1896
|
+
function create$1(context) {
|
|
1897
|
+
if (!context.sourceCode.text.includes("useFormState")) return {};
|
|
1898
|
+
const settings$1 = (0, __eslint_react_shared.getSettingsFromContext)(context);
|
|
1899
|
+
if ((0, compare_versions.compare)(settings$1.version, "19.0.0", "<")) return {};
|
|
1900
|
+
const reactDomNames = /* @__PURE__ */ new Set();
|
|
1901
|
+
const useFormStateNames = /* @__PURE__ */ new Set();
|
|
1902
|
+
return {
|
|
1903
|
+
CallExpression(node) {
|
|
1904
|
+
switch (true) {
|
|
1905
|
+
case node.callee.type === __typescript_eslint_types.AST_NODE_TYPES.Identifier && useFormStateNames.has(node.callee.name):
|
|
1906
|
+
context.report({
|
|
1907
|
+
messageId: "noUseFormState",
|
|
1908
|
+
node,
|
|
1909
|
+
fix: getFix(context, node)
|
|
1910
|
+
});
|
|
1911
|
+
return;
|
|
1912
|
+
case node.callee.type === __typescript_eslint_types.AST_NODE_TYPES.MemberExpression && node.callee.object.type === __typescript_eslint_types.AST_NODE_TYPES.Identifier && node.callee.property.type === __typescript_eslint_types.AST_NODE_TYPES.Identifier && node.callee.property.name === "useFormState" && reactDomNames.has(node.callee.object.name):
|
|
1913
|
+
context.report({
|
|
1914
|
+
messageId: "noUseFormState",
|
|
1915
|
+
node,
|
|
1916
|
+
fix: getFix(context, node)
|
|
1917
|
+
});
|
|
1918
|
+
return;
|
|
1919
|
+
}
|
|
1920
|
+
},
|
|
1921
|
+
ImportDeclaration(node) {
|
|
1922
|
+
const [baseSource] = node.source.value.split("/");
|
|
1923
|
+
if (baseSource !== "react-dom") return;
|
|
1924
|
+
for (const specifier of node.specifiers) switch (specifier.type) {
|
|
1925
|
+
case __typescript_eslint_types.AST_NODE_TYPES.ImportSpecifier:
|
|
1926
|
+
if (specifier.imported.type !== __typescript_eslint_types.AST_NODE_TYPES.Identifier) continue;
|
|
1927
|
+
if (specifier.imported.name === "useFormState") useFormStateNames.add(specifier.local.name);
|
|
1928
|
+
continue;
|
|
1929
|
+
case __typescript_eslint_types.AST_NODE_TYPES.ImportDefaultSpecifier:
|
|
1930
|
+
case __typescript_eslint_types.AST_NODE_TYPES.ImportNamespaceSpecifier:
|
|
1931
|
+
reactDomNames.add(specifier.local.name);
|
|
1932
|
+
continue;
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
};
|
|
1945
1936
|
}
|
|
1946
|
-
function
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
`),
|
|
1952
|
-
fixer.replaceText(node.callee, "useActionState")
|
|
1953
|
-
];
|
|
1954
|
-
};
|
|
1937
|
+
function getFix(context, node) {
|
|
1938
|
+
const { importSource } = (0, __eslint_react_shared.getSettingsFromContext)(context);
|
|
1939
|
+
return (fixer) => {
|
|
1940
|
+
return [fixer.insertTextBefore(context.sourceCode.ast, `import { useActionState } from "${importSource}";\n`), fixer.replaceText(node.callee, "useActionState")];
|
|
1941
|
+
};
|
|
1955
1942
|
}
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1943
|
+
|
|
1944
|
+
//#endregion
|
|
1945
|
+
//#region src/rules/no-void-elements-with-children.ts
|
|
1946
|
+
const RULE_NAME = "no-void-elements-with-children";
|
|
1947
|
+
const RULE_FEATURES = [];
|
|
1948
|
+
const voidElements = new Set([
|
|
1949
|
+
"area",
|
|
1950
|
+
"base",
|
|
1951
|
+
"br",
|
|
1952
|
+
"col",
|
|
1953
|
+
"embed",
|
|
1954
|
+
"hr",
|
|
1955
|
+
"img",
|
|
1956
|
+
"input",
|
|
1957
|
+
"keygen",
|
|
1958
|
+
"link",
|
|
1959
|
+
"menuitem",
|
|
1960
|
+
"meta",
|
|
1961
|
+
"param",
|
|
1962
|
+
"source",
|
|
1963
|
+
"track",
|
|
1964
|
+
"wbr"
|
|
1975
1965
|
]);
|
|
1976
1966
|
var no_void_elements_with_children_default = createRule({
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
create: create16,
|
|
1990
|
-
defaultOptions: []
|
|
1967
|
+
meta: {
|
|
1968
|
+
type: "problem",
|
|
1969
|
+
docs: {
|
|
1970
|
+
description: "Disallow `children` in void DOM elements.",
|
|
1971
|
+
[Symbol.for("rule_features")]: RULE_FEATURES
|
|
1972
|
+
},
|
|
1973
|
+
messages: { noVoidElementsWithChildren: "'{{element}}' is a void element tag and must not have children." },
|
|
1974
|
+
schema: []
|
|
1975
|
+
},
|
|
1976
|
+
name: RULE_NAME,
|
|
1977
|
+
create,
|
|
1978
|
+
defaultOptions: []
|
|
1991
1979
|
});
|
|
1992
|
-
function
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
const hasAttribute3 = (name3) => ER__namespace.hasAttribute(context, name3, attributes, initialScope);
|
|
2012
|
-
if (hasAttribute3("children") || hasAttribute3("dangerouslySetInnerHTML")) {
|
|
2013
|
-
context.report({
|
|
2014
|
-
messageId: "noVoidElementsWithChildren",
|
|
2015
|
-
node,
|
|
2016
|
-
data: {
|
|
2017
|
-
element: elementName
|
|
2018
|
-
}
|
|
2019
|
-
});
|
|
2020
|
-
}
|
|
2021
|
-
}
|
|
2022
|
-
};
|
|
1980
|
+
function create(context) {
|
|
1981
|
+
const resolver = createJsxElementResolver(context);
|
|
1982
|
+
return { JSXElement(node) {
|
|
1983
|
+
const { domElementType: elementName } = resolver.resolve(node);
|
|
1984
|
+
if (elementName.length === 0 || !voidElements.has(elementName)) return;
|
|
1985
|
+
if (node.children.length > 0) context.report({
|
|
1986
|
+
messageId: "noVoidElementsWithChildren",
|
|
1987
|
+
node,
|
|
1988
|
+
data: { element: elementName }
|
|
1989
|
+
});
|
|
1990
|
+
const { attributes } = node.openingElement;
|
|
1991
|
+
const initialScope = context.sourceCode.getScope(node);
|
|
1992
|
+
const hasAttribute = (name$2) => __eslint_react_core.hasAttribute(context, name$2, attributes, initialScope);
|
|
1993
|
+
if (hasAttribute("children") || hasAttribute("dangerouslySetInnerHTML")) context.report({
|
|
1994
|
+
messageId: "noVoidElementsWithChildren",
|
|
1995
|
+
node,
|
|
1996
|
+
data: { element: elementName }
|
|
1997
|
+
});
|
|
1998
|
+
} };
|
|
2023
1999
|
}
|
|
2024
2000
|
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
}
|
|
2001
|
+
//#endregion
|
|
2002
|
+
//#region src/plugin.ts
|
|
2003
|
+
const plugin = {
|
|
2004
|
+
meta: {
|
|
2005
|
+
name,
|
|
2006
|
+
version
|
|
2007
|
+
},
|
|
2008
|
+
rules: {
|
|
2009
|
+
"no-dangerously-set-innerhtml": no_dangerously_set_innerhtml_default,
|
|
2010
|
+
"no-dangerously-set-innerhtml-with-children": no_dangerously_set_innerhtml_with_children_default,
|
|
2011
|
+
"no-find-dom-node": no_find_dom_node_default,
|
|
2012
|
+
"no-flush-sync": no_flush_sync_default,
|
|
2013
|
+
"no-hydrate": no_hydrate_default,
|
|
2014
|
+
"no-missing-button-type": no_missing_button_type_default,
|
|
2015
|
+
"no-missing-iframe-sandbox": no_missing_iframe_sandbox_default,
|
|
2016
|
+
"no-namespace": no_namespace_default,
|
|
2017
|
+
"no-render": no_render_default,
|
|
2018
|
+
"no-render-return-value": no_render_return_value_default,
|
|
2019
|
+
"no-script-url": no_script_url_default,
|
|
2020
|
+
"no-unknown-property": no_unknown_property_default,
|
|
2021
|
+
"no-unsafe-iframe-sandbox": no_unsafe_iframe_sandbox_default,
|
|
2022
|
+
"no-unsafe-target-blank": no_unsafe_target_blank_default,
|
|
2023
|
+
"no-use-form-state": no_use_form_state_default,
|
|
2024
|
+
"no-void-elements-with-children": no_void_elements_with_children_default,
|
|
2025
|
+
"no-children-in-void-dom-elements": no_void_elements_with_children_default
|
|
2026
|
+
}
|
|
2052
2027
|
};
|
|
2053
2028
|
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
}
|
|
2063
|
-
function toLegacyConfig({ rules: rules2 }) {
|
|
2064
|
-
return {
|
|
2065
|
-
plugins: ["react-dom"],
|
|
2066
|
-
rules: rules2
|
|
2067
|
-
};
|
|
2068
|
-
}
|
|
2069
|
-
var index_default = {
|
|
2070
|
-
...plugin,
|
|
2071
|
-
configs: {
|
|
2072
|
-
["recommended"]: toFlatConfig(recommended_exports),
|
|
2073
|
-
["recommended-legacy"]: toLegacyConfig(recommended_exports)
|
|
2074
|
-
}
|
|
2029
|
+
//#endregion
|
|
2030
|
+
//#region src/index.ts
|
|
2031
|
+
const { toFlatConfig, toLegacyConfig } = (0, __eslint_react_shared.getConfigAdapters)("react-dom", plugin);
|
|
2032
|
+
var src_default = {
|
|
2033
|
+
...plugin,
|
|
2034
|
+
configs: {
|
|
2035
|
+
["recommended"]: toFlatConfig(recommended_exports),
|
|
2036
|
+
["recommended-legacy"]: toLegacyConfig(recommended_exports)
|
|
2037
|
+
}
|
|
2075
2038
|
};
|
|
2076
2039
|
|
|
2077
|
-
|
|
2040
|
+
//#endregion
|
|
2041
|
+
module.exports = src_default;
|