eslint-plugin-react-dom 5.24.3 → 5.24.5
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.js +61 -153
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -6,38 +6,27 @@ import { Check, Extract } from "@eslint-react/ast";
|
|
|
6
6
|
import { createImportLookup } from "@eslint-react/var";
|
|
7
7
|
import { AST_NODE_TYPES } from "@typescript-eslint/types";
|
|
8
8
|
import { compare } from "compare-versions";
|
|
9
|
-
|
|
10
9
|
//#region \0rolldown/runtime.js
|
|
11
10
|
var __defProp = Object.defineProperty;
|
|
12
11
|
var __exportAll = (all, no_symbols) => {
|
|
13
12
|
let target = {};
|
|
14
|
-
for (var name in all) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
if (!no_symbols) {
|
|
21
|
-
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
22
|
-
}
|
|
13
|
+
for (var name in all) __defProp(target, name, {
|
|
14
|
+
get: all[name],
|
|
15
|
+
enumerable: true
|
|
16
|
+
});
|
|
17
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
23
18
|
return target;
|
|
24
19
|
};
|
|
25
|
-
|
|
26
20
|
//#endregion
|
|
27
21
|
//#region package.json
|
|
28
22
|
var name$2 = "eslint-plugin-react-dom";
|
|
29
|
-
var version = "5.24.
|
|
30
|
-
|
|
23
|
+
var version = "5.24.5";
|
|
31
24
|
//#endregion
|
|
32
25
|
//#region src/utils/create-rule.ts
|
|
33
26
|
function getDocsUrl(ruleName) {
|
|
34
27
|
return `https://eslint-react.xyz/docs/rules/dom-${ruleName}`;
|
|
35
28
|
}
|
|
36
29
|
const createRule = ESLintUtils.RuleCreator(getDocsUrl);
|
|
37
|
-
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/rules/no-dangerously-set-innerhtml-with-children/no-dangerously-set-innerhtml-with-children.ts
|
|
40
|
-
const RULE_NAME$15 = "no-dangerously-set-innerhtml-with-children";
|
|
41
30
|
var no_dangerously_set_innerhtml_with_children_default = createRule({
|
|
42
31
|
meta: {
|
|
43
32
|
type: "problem",
|
|
@@ -45,9 +34,8 @@ var no_dangerously_set_innerhtml_with_children_default = createRule({
|
|
|
45
34
|
messages: { default: "A DOM component cannot use both children and 'dangerouslySetInnerHTML'." },
|
|
46
35
|
schema: []
|
|
47
36
|
},
|
|
48
|
-
name:
|
|
49
|
-
create: create$15
|
|
50
|
-
defaultOptions: []
|
|
37
|
+
name: "no-dangerously-set-innerhtml-with-children",
|
|
38
|
+
create: create$15
|
|
51
39
|
});
|
|
52
40
|
function create$15(context) {
|
|
53
41
|
if (!context.sourceCode.text.includes("dangerouslySetInnerHTML")) return {};
|
|
@@ -61,10 +49,6 @@ function create$15(context) {
|
|
|
61
49
|
});
|
|
62
50
|
} };
|
|
63
51
|
}
|
|
64
|
-
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region src/rules/no-dangerously-set-innerhtml/no-dangerously-set-innerhtml.ts
|
|
67
|
-
const RULE_NAME$14 = "no-dangerously-set-innerhtml";
|
|
68
52
|
var no_dangerously_set_innerhtml_default = createRule({
|
|
69
53
|
meta: {
|
|
70
54
|
type: "problem",
|
|
@@ -72,9 +56,8 @@ var no_dangerously_set_innerhtml_default = createRule({
|
|
|
72
56
|
messages: { default: "Using 'dangerouslySetInnerHTML' may have security implications." },
|
|
73
57
|
schema: []
|
|
74
58
|
},
|
|
75
|
-
name:
|
|
76
|
-
create: create$14
|
|
77
|
-
defaultOptions: []
|
|
59
|
+
name: "no-dangerously-set-innerhtml",
|
|
60
|
+
create: create$14
|
|
78
61
|
});
|
|
79
62
|
function create$14(context) {
|
|
80
63
|
if (!context.sourceCode.text.includes("dangerouslySetInnerHTML")) return {};
|
|
@@ -87,10 +70,6 @@ function create$14(context) {
|
|
|
87
70
|
});
|
|
88
71
|
} };
|
|
89
72
|
}
|
|
90
|
-
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region src/rules/no-find-dom-node/no-find-dom-node.ts
|
|
93
|
-
const RULE_NAME$13 = "no-find-dom-node";
|
|
94
73
|
var no_find_dom_node_default = createRule({
|
|
95
74
|
meta: {
|
|
96
75
|
type: "problem",
|
|
@@ -98,9 +77,8 @@ var no_find_dom_node_default = createRule({
|
|
|
98
77
|
messages: { default: "[Deprecated] Use alternatives instead." },
|
|
99
78
|
schema: []
|
|
100
79
|
},
|
|
101
|
-
name:
|
|
102
|
-
create: create$13
|
|
103
|
-
defaultOptions: []
|
|
80
|
+
name: "no-find-dom-node",
|
|
81
|
+
create: create$13
|
|
104
82
|
});
|
|
105
83
|
function create$13(context) {
|
|
106
84
|
if (!context.sourceCode.text.includes("findDOMNode")) return {};
|
|
@@ -126,10 +104,6 @@ function create$13(context) {
|
|
|
126
104
|
}
|
|
127
105
|
} };
|
|
128
106
|
}
|
|
129
|
-
|
|
130
|
-
//#endregion
|
|
131
|
-
//#region src/rules/no-flush-sync/no-flush-sync.ts
|
|
132
|
-
const RULE_NAME$12 = "no-flush-sync";
|
|
133
107
|
var no_flush_sync_default = createRule({
|
|
134
108
|
meta: {
|
|
135
109
|
type: "problem",
|
|
@@ -137,9 +111,8 @@ var no_flush_sync_default = createRule({
|
|
|
137
111
|
messages: { default: "Using 'flushSync' is uncommon and can hurt the performance of your app." },
|
|
138
112
|
schema: []
|
|
139
113
|
},
|
|
140
|
-
name:
|
|
141
|
-
create: create$12
|
|
142
|
-
defaultOptions: []
|
|
114
|
+
name: "no-flush-sync",
|
|
115
|
+
create: create$12
|
|
143
116
|
});
|
|
144
117
|
function create$12(context) {
|
|
145
118
|
if (!context.sourceCode.text.includes("flushSync")) return {};
|
|
@@ -162,10 +135,6 @@ function create$12(context) {
|
|
|
162
135
|
}
|
|
163
136
|
} };
|
|
164
137
|
}
|
|
165
|
-
|
|
166
|
-
//#endregion
|
|
167
|
-
//#region src/rules/no-hydrate/no-hydrate.ts
|
|
168
|
-
const RULE_NAME$11 = "no-hydrate";
|
|
169
138
|
var no_hydrate_default = createRule({
|
|
170
139
|
meta: {
|
|
171
140
|
type: "problem",
|
|
@@ -174,9 +143,8 @@ var no_hydrate_default = createRule({
|
|
|
174
143
|
messages: { default: "[Deprecated] Use 'hydrateRoot()' instead." },
|
|
175
144
|
schema: []
|
|
176
145
|
},
|
|
177
|
-
name:
|
|
178
|
-
create: create$11
|
|
179
|
-
defaultOptions: []
|
|
146
|
+
name: "no-hydrate",
|
|
147
|
+
create: create$11
|
|
180
148
|
});
|
|
181
149
|
function create$11(context) {
|
|
182
150
|
if (!context.sourceCode.text.includes("hydrate")) return {};
|
|
@@ -211,7 +179,6 @@ function buildFix$2(context, node) {
|
|
|
211
179
|
return [fixer.insertTextBefore(context.sourceCode.ast, "import { hydrateRoot } from \"react-dom/client\";\n"), fixer.replaceText(node, `hydrateRoot(${getText(arg1)}, ${getText(arg0)})`)];
|
|
212
180
|
};
|
|
213
181
|
}
|
|
214
|
-
|
|
215
182
|
//#endregion
|
|
216
183
|
//#region ../../.pkgs/eff/dist/index.js
|
|
217
184
|
const pipeArguments = (self, args) => {
|
|
@@ -236,7 +203,7 @@ const pipeArguments = (self, args) => {
|
|
|
236
203
|
const Prototype = { pipe() {
|
|
237
204
|
return pipeArguments(this, arguments);
|
|
238
205
|
} };
|
|
239
|
-
|
|
206
|
+
(function() {
|
|
240
207
|
function PipeableBase() {}
|
|
241
208
|
PipeableBase.prototype = Prototype;
|
|
242
209
|
return PipeableBase;
|
|
@@ -271,23 +238,18 @@ const dual = function(arity, body) {
|
|
|
271
238
|
};
|
|
272
239
|
const identity = (a) => a;
|
|
273
240
|
const cast = identity;
|
|
274
|
-
|
|
275
|
-
const constTrue = constant(true);
|
|
276
|
-
const constFalse = constant(false);
|
|
277
|
-
const constNull = constant(null);
|
|
278
|
-
const constUndefined = constant(void 0);
|
|
279
|
-
const compose = dual(2, (ab, bc) => (a) => bc(ab(a)));
|
|
241
|
+
dual(2, (ab, bc) => (a) => bc(ab(a)));
|
|
280
242
|
const absurd = (_) => {
|
|
281
243
|
throw new Error("Called `absurd` function which should be uncallable");
|
|
282
244
|
};
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
245
|
+
cast(absurd);
|
|
246
|
+
dual(2, (a, b) => (data) => a(data) && b(data));
|
|
247
|
+
dual(2, (a, b) => (data) => a(data) || b(data));
|
|
248
|
+
dual(2, (a, b) => (data) => a(data) !== b(data));
|
|
249
|
+
dual(2, (a, b) => (data) => a(data) === b(data));
|
|
250
|
+
dual(2, (antecedent, consequent) => (data) => !antecedent(data) || consequent(data));
|
|
251
|
+
dual(2, (a, b) => (data) => !a(data) && !b(data));
|
|
252
|
+
dual(2, (a, b) => (data) => !a(data) || !b(data));
|
|
291
253
|
function isString(input) {
|
|
292
254
|
return typeof input === "string";
|
|
293
255
|
}
|
|
@@ -297,22 +259,21 @@ function isFunction(input) {
|
|
|
297
259
|
function isObjectKeyword(input) {
|
|
298
260
|
return typeof input === "object" && input !== null || isFunction(input);
|
|
299
261
|
}
|
|
300
|
-
|
|
301
|
-
|
|
262
|
+
dual(2, (data, property) => isObjectKeyword(data) && property in data);
|
|
263
|
+
dual(2, (self, predicate) => {
|
|
302
264
|
const input = Array.isArray(self) ? self : Array.from(self);
|
|
303
265
|
const len = input.length;
|
|
304
266
|
let idx = 0;
|
|
305
267
|
while (idx < len && predicate(input[idx], idx)) idx++;
|
|
306
268
|
return input.slice(idx);
|
|
307
269
|
});
|
|
308
|
-
|
|
270
|
+
dual(2, (self, predicate) => {
|
|
309
271
|
const input = Array.isArray(self) ? self : Array.from(self);
|
|
310
272
|
const len = input.length;
|
|
311
273
|
let idx = 0;
|
|
312
274
|
while (idx < len && predicate(input[idx], idx)) idx++;
|
|
313
275
|
return input.slice(0, idx);
|
|
314
276
|
});
|
|
315
|
-
|
|
316
277
|
//#endregion
|
|
317
278
|
//#region src/utils/create-jsx-element-resolver.ts
|
|
318
279
|
function createJsxElementResolver(context) {
|
|
@@ -333,7 +294,6 @@ function createJsxElementResolver(context) {
|
|
|
333
294
|
return result;
|
|
334
295
|
} };
|
|
335
296
|
}
|
|
336
|
-
|
|
337
297
|
//#endregion
|
|
338
298
|
//#region src/rules/no-missing-button-type/no-missing-button-type.ts
|
|
339
299
|
const RULE_NAME$10 = "no-missing-button-type";
|
|
@@ -354,8 +314,7 @@ var no_missing_button_type_default = createRule({
|
|
|
354
314
|
schema: []
|
|
355
315
|
},
|
|
356
316
|
name: RULE_NAME$10,
|
|
357
|
-
create: create$10
|
|
358
|
-
defaultOptions: []
|
|
317
|
+
create: create$10
|
|
359
318
|
});
|
|
360
319
|
function create$10(context) {
|
|
361
320
|
const resolver = createJsxElementResolver(context);
|
|
@@ -376,10 +335,6 @@ function create$10(context) {
|
|
|
376
335
|
});
|
|
377
336
|
} };
|
|
378
337
|
}
|
|
379
|
-
|
|
380
|
-
//#endregion
|
|
381
|
-
//#region src/rules/no-missing-iframe-sandbox/no-missing-iframe-sandbox.ts
|
|
382
|
-
const RULE_NAME$9 = "no-missing-iframe-sandbox";
|
|
383
338
|
var no_missing_iframe_sandbox_default = createRule({
|
|
384
339
|
meta: {
|
|
385
340
|
type: "problem",
|
|
@@ -392,9 +347,8 @@ var no_missing_iframe_sandbox_default = createRule({
|
|
|
392
347
|
},
|
|
393
348
|
schema: []
|
|
394
349
|
},
|
|
395
|
-
name:
|
|
396
|
-
create: create$9
|
|
397
|
-
defaultOptions: []
|
|
350
|
+
name: "no-missing-iframe-sandbox",
|
|
351
|
+
create: create$9
|
|
398
352
|
});
|
|
399
353
|
function create$9(context) {
|
|
400
354
|
const resolver = createJsxElementResolver(context);
|
|
@@ -432,7 +386,6 @@ function create$9(context) {
|
|
|
432
386
|
});
|
|
433
387
|
} };
|
|
434
388
|
}
|
|
435
|
-
|
|
436
389
|
//#endregion
|
|
437
390
|
//#region src/rules/no-render-return-value/no-render-return-value.ts
|
|
438
391
|
const RULE_NAME$8 = "no-render-return-value";
|
|
@@ -451,8 +404,7 @@ var no_render_return_value_default = createRule({
|
|
|
451
404
|
schema: []
|
|
452
405
|
},
|
|
453
406
|
name: RULE_NAME$8,
|
|
454
|
-
create: create$8
|
|
455
|
-
defaultOptions: []
|
|
407
|
+
create: create$8
|
|
456
408
|
});
|
|
457
409
|
function create$8(context) {
|
|
458
410
|
if (!context.sourceCode.text.includes("render")) return {};
|
|
@@ -483,10 +435,6 @@ function isReturnValueUsed(node) {
|
|
|
483
435
|
while (Check.isTypeExpression(parent)) parent = parent.parent;
|
|
484
436
|
return BANNED_PARENT_TYPES.includes(parent.type);
|
|
485
437
|
}
|
|
486
|
-
|
|
487
|
-
//#endregion
|
|
488
|
-
//#region src/rules/no-render/no-render.ts
|
|
489
|
-
const RULE_NAME$7 = "no-render";
|
|
490
438
|
var no_render_default = createRule({
|
|
491
439
|
meta: {
|
|
492
440
|
type: "problem",
|
|
@@ -495,9 +443,8 @@ var no_render_default = createRule({
|
|
|
495
443
|
messages: { default: "[Deprecated] Use 'createRoot(node).render()' instead." },
|
|
496
444
|
schema: []
|
|
497
445
|
},
|
|
498
|
-
name:
|
|
499
|
-
create: create$7
|
|
500
|
-
defaultOptions: []
|
|
446
|
+
name: "no-render",
|
|
447
|
+
create: create$7
|
|
501
448
|
});
|
|
502
449
|
function create$7(context) {
|
|
503
450
|
if (!context.sourceCode.text.includes("render")) return {};
|
|
@@ -535,10 +482,6 @@ function buildFix$1(context, node) {
|
|
|
535
482
|
return [fixer.insertTextBefore(context.sourceCode.ast, "import { createRoot } from \"react-dom/client\";\n"), fixer.replaceText(node, `createRoot(${getText(arg1)}).render(${getText(arg0)})`)];
|
|
536
483
|
};
|
|
537
484
|
}
|
|
538
|
-
|
|
539
|
-
//#endregion
|
|
540
|
-
//#region src/rules/no-script-url/no-script-url.ts
|
|
541
|
-
const RULE_NAME$6 = "no-script-url";
|
|
542
485
|
var no_script_url_default = createRule({
|
|
543
486
|
meta: {
|
|
544
487
|
type: "problem",
|
|
@@ -546,9 +489,8 @@ var no_script_url_default = createRule({
|
|
|
546
489
|
messages: { default: "Using a `javascript:` URL is a security risk and should be avoided." },
|
|
547
490
|
schema: []
|
|
548
491
|
},
|
|
549
|
-
name:
|
|
550
|
-
create: create$6
|
|
551
|
-
defaultOptions: []
|
|
492
|
+
name: "no-script-url",
|
|
493
|
+
create: create$6
|
|
552
494
|
});
|
|
553
495
|
function create$6(context) {
|
|
554
496
|
return { JSXAttribute(node) {
|
|
@@ -560,10 +502,6 @@ function create$6(context) {
|
|
|
560
502
|
});
|
|
561
503
|
} };
|
|
562
504
|
}
|
|
563
|
-
|
|
564
|
-
//#endregion
|
|
565
|
-
//#region src/rules/no-string-style-prop/no-string-style-prop.ts
|
|
566
|
-
const RULE_NAME$5 = "no-string-style-prop";
|
|
567
505
|
var no_string_style_prop_default = createRule({
|
|
568
506
|
meta: {
|
|
569
507
|
type: "problem",
|
|
@@ -571,9 +509,8 @@ var no_string_style_prop_default = createRule({
|
|
|
571
509
|
messages: { default: "Do not use string style prop. Use an object instead." },
|
|
572
510
|
schema: []
|
|
573
511
|
},
|
|
574
|
-
name:
|
|
575
|
-
create: create$5
|
|
576
|
-
defaultOptions: []
|
|
512
|
+
name: "no-string-style-prop",
|
|
513
|
+
create: create$5
|
|
577
514
|
});
|
|
578
515
|
function create$5(context) {
|
|
579
516
|
return { JSXElement(node) {
|
|
@@ -588,7 +525,6 @@ function create$5(context) {
|
|
|
588
525
|
});
|
|
589
526
|
} };
|
|
590
527
|
}
|
|
591
|
-
|
|
592
528
|
//#endregion
|
|
593
529
|
//#region src/rules/no-unknown-property/lib.ts
|
|
594
530
|
const DOM_ATTRIBUTE_NAMES = {
|
|
@@ -1468,14 +1404,13 @@ const REACT_ON_PROPS = [
|
|
|
1468
1404
|
"onPointerUp",
|
|
1469
1405
|
"onPointerUpCapture"
|
|
1470
1406
|
];
|
|
1471
|
-
const
|
|
1407
|
+
const REACT_19_PROPS = [...[
|
|
1472
1408
|
"popover",
|
|
1473
1409
|
"popoverTarget",
|
|
1474
1410
|
"popoverTargetAction",
|
|
1475
1411
|
"onToggle",
|
|
1476
1412
|
"onBeforeToggle"
|
|
1477
|
-
];
|
|
1478
|
-
const REACT_19_PROPS = [...POPOVER_API_PROPS];
|
|
1413
|
+
]];
|
|
1479
1414
|
const REACT_19_ATTRIBUTE_TAGS_MAP = {
|
|
1480
1415
|
blocking: [
|
|
1481
1416
|
"link",
|
|
@@ -1560,7 +1495,6 @@ function getStandardName(name, context) {
|
|
|
1560
1495
|
function getText(context, node) {
|
|
1561
1496
|
return context.sourceCode.getText(node);
|
|
1562
1497
|
}
|
|
1563
|
-
|
|
1564
1498
|
//#endregion
|
|
1565
1499
|
//#region src/rules/no-unknown-property/no-unknown-property.ts
|
|
1566
1500
|
const RULE_NAME$4 = "no-unknown-property";
|
|
@@ -1568,36 +1502,36 @@ const DEFAULTS = {
|
|
|
1568
1502
|
ignore: [],
|
|
1569
1503
|
requireDataLowercase: false
|
|
1570
1504
|
};
|
|
1571
|
-
const messages = {
|
|
1572
|
-
"data-lowercase-required": "React does not recognize data-* props with uppercase characters on a DOM element. Found '{{name}}', use '{{lowerCaseName}}' instead",
|
|
1573
|
-
"invalid-prop-on-tag": "Invalid property '{{name}}' found on tag '{{tagName}}', but it is only allowed on: {{allowedTags}}",
|
|
1574
|
-
"unknown-prop": "Unknown property '{{name}}' found",
|
|
1575
|
-
"unknown-prop-with-standard-name": "Unknown property '{{name}}' found, use '{{standardName}}' instead"
|
|
1576
|
-
};
|
|
1577
1505
|
var no_unknown_property_default = createRule({
|
|
1578
1506
|
meta: {
|
|
1579
1507
|
type: "problem",
|
|
1508
|
+
defaultOptions: [DEFAULTS],
|
|
1580
1509
|
docs: { description: "Disallows unknown 'DOM' properties." },
|
|
1581
1510
|
fixable: "code",
|
|
1582
|
-
messages
|
|
1511
|
+
messages: {
|
|
1512
|
+
"data-lowercase-required": "React does not recognize data-* props with uppercase characters on a DOM element. Found '{{name}}', use '{{lowerCaseName}}' instead",
|
|
1513
|
+
"invalid-prop-on-tag": "Invalid property '{{name}}' found on tag '{{tagName}}', but it is only allowed on: {{allowedTags}}",
|
|
1514
|
+
"unknown-prop": "Unknown property '{{name}}' found",
|
|
1515
|
+
"unknown-prop-with-standard-name": "Unknown property '{{name}}' found, use '{{standardName}}' instead"
|
|
1516
|
+
},
|
|
1583
1517
|
schema: [{
|
|
1584
1518
|
type: "object",
|
|
1585
1519
|
additionalProperties: false,
|
|
1586
1520
|
properties: {
|
|
1587
1521
|
ignore: {
|
|
1588
1522
|
type: "array",
|
|
1523
|
+
description: "Property names to ignore.",
|
|
1589
1524
|
items: { type: "string" }
|
|
1590
1525
|
},
|
|
1591
1526
|
requireDataLowercase: {
|
|
1592
1527
|
type: "boolean",
|
|
1593
|
-
|
|
1528
|
+
description: "Require lowercase names for data-* attributes."
|
|
1594
1529
|
}
|
|
1595
1530
|
}
|
|
1596
1531
|
}]
|
|
1597
1532
|
},
|
|
1598
1533
|
name: RULE_NAME$4,
|
|
1599
|
-
create: create$4
|
|
1600
|
-
defaultOptions: []
|
|
1534
|
+
create: create$4
|
|
1601
1535
|
});
|
|
1602
1536
|
function create$4(context) {
|
|
1603
1537
|
function getIgnoreConfig() {
|
|
@@ -1665,7 +1599,6 @@ function create$4(context) {
|
|
|
1665
1599
|
});
|
|
1666
1600
|
} };
|
|
1667
1601
|
}
|
|
1668
|
-
|
|
1669
1602
|
//#endregion
|
|
1670
1603
|
//#region src/rules/no-unsafe-iframe-sandbox/no-unsafe-iframe-sandbox.ts
|
|
1671
1604
|
const RULE_NAME$3 = "no-unsafe-iframe-sandbox";
|
|
@@ -1678,8 +1611,7 @@ var no_unsafe_iframe_sandbox_default = createRule({
|
|
|
1678
1611
|
schema: []
|
|
1679
1612
|
},
|
|
1680
1613
|
name: RULE_NAME$3,
|
|
1681
|
-
create: create$3
|
|
1682
|
-
defaultOptions: []
|
|
1614
|
+
create: create$3
|
|
1683
1615
|
});
|
|
1684
1616
|
function create$3(context) {
|
|
1685
1617
|
const resolver = createJsxElementResolver(context);
|
|
@@ -1697,7 +1629,6 @@ function create$3(context) {
|
|
|
1697
1629
|
});
|
|
1698
1630
|
} };
|
|
1699
1631
|
}
|
|
1700
|
-
|
|
1701
1632
|
//#endregion
|
|
1702
1633
|
//#region src/rules/no-unsafe-target-blank/lib.ts
|
|
1703
1634
|
function isExternalLinkLike(value) {
|
|
@@ -1708,10 +1639,6 @@ function isSafeRel(value) {
|
|
|
1708
1639
|
if (!isString(value)) return false;
|
|
1709
1640
|
return value === "noreferrer" || /\bnoreferrer\b/u.test(value);
|
|
1710
1641
|
}
|
|
1711
|
-
|
|
1712
|
-
//#endregion
|
|
1713
|
-
//#region src/rules/no-unsafe-target-blank/no-unsafe-target-blank.ts
|
|
1714
|
-
const RULE_NAME$2 = "no-unsafe-target-blank";
|
|
1715
1642
|
var no_unsafe_target_blank_default = createRule({
|
|
1716
1643
|
meta: {
|
|
1717
1644
|
type: "problem",
|
|
@@ -1724,9 +1651,8 @@ var no_unsafe_target_blank_default = createRule({
|
|
|
1724
1651
|
},
|
|
1725
1652
|
schema: []
|
|
1726
1653
|
},
|
|
1727
|
-
name:
|
|
1728
|
-
create: create$2
|
|
1729
|
-
defaultOptions: []
|
|
1654
|
+
name: "no-unsafe-target-blank",
|
|
1655
|
+
create: create$2
|
|
1730
1656
|
});
|
|
1731
1657
|
function create$2(context) {
|
|
1732
1658
|
const resolver = createJsxElementResolver(context);
|
|
@@ -1734,8 +1660,7 @@ function create$2(context) {
|
|
|
1734
1660
|
const { domElementType } = resolver.resolve(node);
|
|
1735
1661
|
if (domElementType !== "a") return;
|
|
1736
1662
|
if (getAttributeStaticValue(context, node, "target") !== "_blank") return;
|
|
1737
|
-
|
|
1738
|
-
if (!isExternalLinkLike(hrefValue)) return;
|
|
1663
|
+
if (!isExternalLinkLike(getAttributeStaticValue(context, node, "href"))) return;
|
|
1739
1664
|
const relProp = findAttribute(context, node, "rel");
|
|
1740
1665
|
if (relProp == null) {
|
|
1741
1666
|
context.report({
|
|
@@ -1750,8 +1675,7 @@ function create$2(context) {
|
|
|
1750
1675
|
});
|
|
1751
1676
|
return;
|
|
1752
1677
|
}
|
|
1753
|
-
|
|
1754
|
-
if (isSafeRel(relValue)) return;
|
|
1678
|
+
if (isSafeRel(getAttributeStaticValue(context, node, "rel"))) return;
|
|
1755
1679
|
context.report({
|
|
1756
1680
|
messageId: "default",
|
|
1757
1681
|
node: relProp,
|
|
@@ -1764,10 +1688,6 @@ function create$2(context) {
|
|
|
1764
1688
|
});
|
|
1765
1689
|
} };
|
|
1766
1690
|
}
|
|
1767
|
-
|
|
1768
|
-
//#endregion
|
|
1769
|
-
//#region src/rules/no-use-form-state/no-use-form-state.ts
|
|
1770
|
-
const RULE_NAME$1 = "no-use-form-state";
|
|
1771
1691
|
var no_use_form_state_default = createRule({
|
|
1772
1692
|
meta: {
|
|
1773
1693
|
type: "problem",
|
|
@@ -1776,9 +1696,8 @@ var no_use_form_state_default = createRule({
|
|
|
1776
1696
|
messages: { default: "[Deprecated] Use 'useActionState' from 'react' package instead." },
|
|
1777
1697
|
schema: []
|
|
1778
1698
|
},
|
|
1779
|
-
name:
|
|
1780
|
-
create: create$1
|
|
1781
|
-
defaultOptions: []
|
|
1699
|
+
name: "no-use-form-state",
|
|
1700
|
+
create: create$1
|
|
1782
1701
|
});
|
|
1783
1702
|
function create$1(context) {
|
|
1784
1703
|
if (!context.sourceCode.text.includes("useFormState")) return {};
|
|
@@ -1811,7 +1730,6 @@ function buildFix(context, node) {
|
|
|
1811
1730
|
return [fixer.insertTextBefore(context.sourceCode.ast, `import { useActionState } from "${importSource}";\n`), fixer.replaceText(node.callee, "useActionState")];
|
|
1812
1731
|
};
|
|
1813
1732
|
}
|
|
1814
|
-
|
|
1815
1733
|
//#endregion
|
|
1816
1734
|
//#region src/rules/no-void-elements-with-children/lib.ts
|
|
1817
1735
|
const KNOWN_VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
|
@@ -1832,10 +1750,6 @@ const KNOWN_VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
|
|
1832
1750
|
"track",
|
|
1833
1751
|
"wbr"
|
|
1834
1752
|
]);
|
|
1835
|
-
|
|
1836
|
-
//#endregion
|
|
1837
|
-
//#region src/rules/no-void-elements-with-children/no-void-elements-with-children.ts
|
|
1838
|
-
const RULE_NAME = "no-void-elements-with-children";
|
|
1839
1753
|
var no_void_elements_with_children_default = createRule({
|
|
1840
1754
|
meta: {
|
|
1841
1755
|
type: "problem",
|
|
@@ -1843,9 +1757,8 @@ var no_void_elements_with_children_default = createRule({
|
|
|
1843
1757
|
messages: { default: "'{{elementType}}' is a void element tag and must not have children." },
|
|
1844
1758
|
schema: []
|
|
1845
1759
|
},
|
|
1846
|
-
name:
|
|
1847
|
-
create
|
|
1848
|
-
defaultOptions: []
|
|
1760
|
+
name: "no-void-elements-with-children",
|
|
1761
|
+
create
|
|
1849
1762
|
});
|
|
1850
1763
|
function create(context) {
|
|
1851
1764
|
const resolver = createJsxElementResolver(context);
|
|
@@ -1859,7 +1772,6 @@ function create(context) {
|
|
|
1859
1772
|
});
|
|
1860
1773
|
} };
|
|
1861
1774
|
}
|
|
1862
|
-
|
|
1863
1775
|
//#endregion
|
|
1864
1776
|
//#region src/plugin.ts
|
|
1865
1777
|
const plugin = {
|
|
@@ -1886,7 +1798,6 @@ const plugin = {
|
|
|
1886
1798
|
"no-void-elements-with-children": no_void_elements_with_children_default
|
|
1887
1799
|
}
|
|
1888
1800
|
};
|
|
1889
|
-
|
|
1890
1801
|
//#endregion
|
|
1891
1802
|
//#region src/configs/recommended.ts
|
|
1892
1803
|
var recommended_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1911,7 +1822,6 @@ const rules$1 = {
|
|
|
1911
1822
|
};
|
|
1912
1823
|
const plugins$1 = { "react-dom": plugin };
|
|
1913
1824
|
const settings$1 = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
1914
|
-
|
|
1915
1825
|
//#endregion
|
|
1916
1826
|
//#region src/configs/strict.ts
|
|
1917
1827
|
var strict_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1929,7 +1839,6 @@ const rules = {
|
|
|
1929
1839
|
};
|
|
1930
1840
|
const plugins = { ...plugins$1 };
|
|
1931
1841
|
const settings = { ...settings$1 };
|
|
1932
|
-
|
|
1933
1842
|
//#endregion
|
|
1934
1843
|
//#region src/index.ts
|
|
1935
1844
|
function createConfig(base) {
|
|
@@ -1950,6 +1859,5 @@ const finalPlugin = {
|
|
|
1950
1859
|
["strict"]: createConfig(strict_exports)
|
|
1951
1860
|
}
|
|
1952
1861
|
};
|
|
1953
|
-
|
|
1954
1862
|
//#endregion
|
|
1955
|
-
export { finalPlugin as default };
|
|
1863
|
+
export { finalPlugin as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-dom",
|
|
3
|
-
"version": "5.24.
|
|
3
|
+
"version": "5.24.5",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for DOM related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@eslint-react/ast": "5.24.
|
|
41
|
-
"@eslint-react/eslint": "5.24.
|
|
42
|
-
"@eslint-react/jsx": "5.24.
|
|
43
|
-
"@eslint-react/shared": "5.24.
|
|
44
|
-
"@eslint-react/var": "5.24.
|
|
40
|
+
"@eslint-react/ast": "5.24.5",
|
|
41
|
+
"@eslint-react/eslint": "5.24.5",
|
|
42
|
+
"@eslint-react/jsx": "5.24.5",
|
|
43
|
+
"@eslint-react/shared": "5.24.5",
|
|
44
|
+
"@eslint-react/var": "5.24.5",
|
|
45
45
|
"@typescript-eslint/types": "^8.71.0",
|
|
46
46
|
"@typescript-eslint/utils": "^8.71.0",
|
|
47
47
|
"compare-versions": "^6.1.1",
|