eslint-plugin-react-dom 2.4.0-next.9 → 2.4.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +19 -87
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (all, symbols) => {
|
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region package.json
|
|
25
25
|
var name$2 = "eslint-plugin-react-dom";
|
|
26
|
-
var version = "2.4.
|
|
26
|
+
var version = "2.4.1-beta.0";
|
|
27
27
|
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/utils/create-jsx-element-resolver.ts
|
|
@@ -69,15 +69,11 @@ const createRule = ESLintUtils.RuleCreator(getDocsUrl);
|
|
|
69
69
|
//#endregion
|
|
70
70
|
//#region src/rules/no-dangerously-set-innerhtml.ts
|
|
71
71
|
const RULE_NAME$17 = "no-dangerously-set-innerhtml";
|
|
72
|
-
const RULE_FEATURES$16 = [];
|
|
73
72
|
const DSIH$1 = "dangerouslySetInnerHTML";
|
|
74
73
|
var no_dangerously_set_innerhtml_default = createRule({
|
|
75
74
|
meta: {
|
|
76
75
|
type: "problem",
|
|
77
|
-
docs: {
|
|
78
|
-
description: "Disallow `dangerouslySetInnerHTML`.",
|
|
79
|
-
[Symbol.for("rule_features")]: RULE_FEATURES$16
|
|
80
|
-
},
|
|
76
|
+
docs: { description: "Disallow 'dangerouslySetInnerHTML'." },
|
|
81
77
|
messages: { noDangerouslySetInnerhtml: "Using 'dangerouslySetInnerHTML' may have security implications." },
|
|
82
78
|
schema: []
|
|
83
79
|
},
|
|
@@ -100,14 +96,10 @@ function create$17(context) {
|
|
|
100
96
|
//#endregion
|
|
101
97
|
//#region src/rules/no-dangerously-set-innerhtml-with-children.ts
|
|
102
98
|
const RULE_NAME$16 = "no-dangerously-set-innerhtml-with-children";
|
|
103
|
-
const RULE_FEATURES$15 = [];
|
|
104
99
|
var no_dangerously_set_innerhtml_with_children_default = createRule({
|
|
105
100
|
meta: {
|
|
106
101
|
type: "problem",
|
|
107
|
-
docs: {
|
|
108
|
-
description: "Disallow `dangerouslySetInnerHTML` and `children` at the same time.",
|
|
109
|
-
[Symbol.for("rule_features")]: RULE_FEATURES$15
|
|
110
|
-
},
|
|
102
|
+
docs: { description: "Disallow 'dangerouslySetInnerHTML' and 'children' at the same time." },
|
|
111
103
|
messages: { noDangerouslySetInnerhtmlWithChildren: "A DOM component cannot use both children and 'dangerouslySetInnerHTML'." },
|
|
112
104
|
schema: []
|
|
113
105
|
},
|
|
@@ -142,14 +134,10 @@ function create$16(context) {
|
|
|
142
134
|
//#endregion
|
|
143
135
|
//#region src/rules/no-find-dom-node.ts
|
|
144
136
|
const RULE_NAME$15 = "no-find-dom-node";
|
|
145
|
-
const RULE_FEATURES$14 = [];
|
|
146
137
|
var no_find_dom_node_default = createRule({
|
|
147
138
|
meta: {
|
|
148
139
|
type: "problem",
|
|
149
|
-
docs: {
|
|
150
|
-
description: "Disallow `findDOMNode`.",
|
|
151
|
-
[Symbol.for("rule_features")]: RULE_FEATURES$14
|
|
152
|
-
},
|
|
140
|
+
docs: { description: "Disallow 'findDOMNode'." },
|
|
153
141
|
messages: { noFindDomNode: "[Deprecated] Use alternatives instead." },
|
|
154
142
|
schema: []
|
|
155
143
|
},
|
|
@@ -182,14 +170,10 @@ function create$15(context) {
|
|
|
182
170
|
//#endregion
|
|
183
171
|
//#region src/rules/no-flush-sync.ts
|
|
184
172
|
const RULE_NAME$14 = "no-flush-sync";
|
|
185
|
-
const RULE_FEATURES$13 = [];
|
|
186
173
|
var no_flush_sync_default = createRule({
|
|
187
174
|
meta: {
|
|
188
175
|
type: "problem",
|
|
189
|
-
docs: {
|
|
190
|
-
description: "Disallow `flushSync`.",
|
|
191
|
-
[Symbol.for("rule_features")]: RULE_FEATURES$13
|
|
192
|
-
},
|
|
176
|
+
docs: { description: "Disallow 'flushSync'." },
|
|
193
177
|
messages: { noFlushSync: "Using 'flushSync' is uncommon and can hurt the performance of your app." },
|
|
194
178
|
schema: []
|
|
195
179
|
},
|
|
@@ -222,14 +206,10 @@ function create$14(context) {
|
|
|
222
206
|
//#endregion
|
|
223
207
|
//#region src/rules/no-hydrate.ts
|
|
224
208
|
const RULE_NAME$13 = "no-hydrate";
|
|
225
|
-
const RULE_FEATURES$12 = ["MOD"];
|
|
226
209
|
var no_hydrate_default = createRule({
|
|
227
210
|
meta: {
|
|
228
211
|
type: "problem",
|
|
229
|
-
docs: {
|
|
230
|
-
description: "Replaces usages of `ReactDom.hydrate()` with `hydrateRoot()`.",
|
|
231
|
-
[Symbol.for("rule_features")]: RULE_FEATURES$12
|
|
232
|
-
},
|
|
212
|
+
docs: { description: "Replaces usages of 'ReactDom.hydrate()' with 'hydrateRoot()'." },
|
|
233
213
|
fixable: "code",
|
|
234
214
|
messages: { noHydrate: "[Deprecated] Use 'hydrateRoot()' instead." },
|
|
235
215
|
schema: []
|
|
@@ -291,7 +271,6 @@ function getFix$2(context, node) {
|
|
|
291
271
|
//#endregion
|
|
292
272
|
//#region src/rules/no-missing-button-type.ts
|
|
293
273
|
const RULE_NAME$12 = "no-missing-button-type";
|
|
294
|
-
const RULE_FEATURES$11 = ["FIX"];
|
|
295
274
|
const BUTTON_TYPES = [
|
|
296
275
|
"button",
|
|
297
276
|
"submit",
|
|
@@ -300,10 +279,7 @@ const BUTTON_TYPES = [
|
|
|
300
279
|
var no_missing_button_type_default = createRule({
|
|
301
280
|
meta: {
|
|
302
281
|
type: "problem",
|
|
303
|
-
docs: {
|
|
304
|
-
description: "Enforces explicit `type` attribute for `button` elements.",
|
|
305
|
-
[Symbol.for("rule_features")]: RULE_FEATURES$11
|
|
306
|
-
},
|
|
282
|
+
docs: { description: "Enforces explicit 'type' attribute for 'button' elements." },
|
|
307
283
|
hasSuggestions: true,
|
|
308
284
|
messages: {
|
|
309
285
|
addButtonType: "Add 'type' attribute with value '{{type}}'.",
|
|
@@ -335,14 +311,10 @@ function create$12(context) {
|
|
|
335
311
|
//#endregion
|
|
336
312
|
//#region src/rules/no-missing-iframe-sandbox.ts
|
|
337
313
|
const RULE_NAME$11 = "no-missing-iframe-sandbox";
|
|
338
|
-
const RULE_FEATURES$10 = ["FIX"];
|
|
339
314
|
var no_missing_iframe_sandbox_default = createRule({
|
|
340
315
|
meta: {
|
|
341
316
|
type: "problem",
|
|
342
|
-
docs: {
|
|
343
|
-
description: "Enforces explicit `sandbox` prop for `iframe` elements.",
|
|
344
|
-
[Symbol.for("rule_features")]: RULE_FEATURES$10
|
|
345
|
-
},
|
|
317
|
+
docs: { description: "Enforces explicit 'sandbox' attribute for 'iframe' elements." },
|
|
346
318
|
fixable: "code",
|
|
347
319
|
hasSuggestions: true,
|
|
348
320
|
messages: {
|
|
@@ -395,14 +367,10 @@ function create$11(context) {
|
|
|
395
367
|
//#endregion
|
|
396
368
|
//#region src/rules/no-namespace.ts
|
|
397
369
|
const RULE_NAME$10 = "no-namespace";
|
|
398
|
-
const RULE_FEATURES$9 = [];
|
|
399
370
|
var no_namespace_default = createRule({
|
|
400
371
|
meta: {
|
|
401
372
|
type: "problem",
|
|
402
|
-
docs: {
|
|
403
|
-
description: "Enforces the absence of a `namespace` in React elements.",
|
|
404
|
-
[Symbol.for("rule_features")]: RULE_FEATURES$9
|
|
405
|
-
},
|
|
373
|
+
docs: { description: "Enforces the absence of a 'namespace' in React elements." },
|
|
406
374
|
messages: { noNamespace: "A React component '{{name}}' must not be in a namespace, as React does not support them." },
|
|
407
375
|
schema: []
|
|
408
376
|
},
|
|
@@ -425,14 +393,10 @@ function create$10(context) {
|
|
|
425
393
|
//#endregion
|
|
426
394
|
//#region src/rules/no-render.ts
|
|
427
395
|
const RULE_NAME$9 = "no-render";
|
|
428
|
-
const RULE_FEATURES$8 = ["MOD"];
|
|
429
396
|
var no_render_default = createRule({
|
|
430
397
|
meta: {
|
|
431
398
|
type: "problem",
|
|
432
|
-
docs: {
|
|
433
|
-
description: "Replaces usages of `ReactDom.render()` with `createRoot(node).render()`.",
|
|
434
|
-
[Symbol.for("rule_features")]: RULE_FEATURES$8
|
|
435
|
-
},
|
|
399
|
+
docs: { description: "Replaces usages of 'ReactDom.render()' with 'createRoot(node).render()'." },
|
|
436
400
|
fixable: "code",
|
|
437
401
|
messages: { noRender: "[Deprecated] Use 'createRoot(node).render()' instead." },
|
|
438
402
|
schema: []
|
|
@@ -499,7 +463,6 @@ function getFix$1(context, node) {
|
|
|
499
463
|
//#endregion
|
|
500
464
|
//#region src/rules/no-render-return-value.ts
|
|
501
465
|
const RULE_NAME$8 = "no-render-return-value";
|
|
502
|
-
const RULE_FEATURES$7 = [];
|
|
503
466
|
const banParentTypes = [
|
|
504
467
|
AST_NODE_TYPES.VariableDeclarator,
|
|
505
468
|
AST_NODE_TYPES.Property,
|
|
@@ -510,10 +473,7 @@ const banParentTypes = [
|
|
|
510
473
|
var no_render_return_value_default = createRule({
|
|
511
474
|
meta: {
|
|
512
475
|
type: "problem",
|
|
513
|
-
docs: {
|
|
514
|
-
description: "Disallow the return value of `ReactDOM.render`.",
|
|
515
|
-
[Symbol.for("rule_features")]: RULE_FEATURES$7
|
|
516
|
-
},
|
|
476
|
+
docs: { description: "Disallow the return value of 'ReactDOM.render'." },
|
|
517
477
|
messages: { noRenderReturnValue: "Do not depend on the return value from 'ReactDOM.render'." },
|
|
518
478
|
schema: []
|
|
519
479
|
},
|
|
@@ -561,14 +521,10 @@ function create$8(context) {
|
|
|
561
521
|
//#endregion
|
|
562
522
|
//#region src/rules/no-script-url.ts
|
|
563
523
|
const RULE_NAME$7 = "no-script-url";
|
|
564
|
-
const RULE_FEATURES$6 = [];
|
|
565
524
|
var no_script_url_default = createRule({
|
|
566
525
|
meta: {
|
|
567
526
|
type: "problem",
|
|
568
|
-
docs: {
|
|
569
|
-
description: "Disallow `javascript:` URLs as attribute values.",
|
|
570
|
-
[Symbol.for("rule_features")]: RULE_FEATURES$6
|
|
571
|
-
},
|
|
527
|
+
docs: { description: "Disallow 'javascript:' URLs as attribute values." },
|
|
572
528
|
messages: { noScriptUrl: "Using a `javascript:` URL is a security risk and should be avoided." },
|
|
573
529
|
schema: []
|
|
574
530
|
},
|
|
@@ -590,14 +546,10 @@ function create$7(context) {
|
|
|
590
546
|
//#endregion
|
|
591
547
|
//#region src/rules/no-string-style-prop.ts
|
|
592
548
|
const RULE_NAME$6 = "no-string-style-prop";
|
|
593
|
-
const RULE_FEATURES$5 = [];
|
|
594
549
|
var no_string_style_prop_default = createRule({
|
|
595
550
|
meta: {
|
|
596
551
|
type: "problem",
|
|
597
|
-
docs: {
|
|
598
|
-
description: "Disallows the use of string style prop.",
|
|
599
|
-
[Symbol.for("rule_features")]: RULE_FEATURES$5
|
|
600
|
-
},
|
|
552
|
+
docs: { description: "Disallow string values for the 'style' prop." },
|
|
601
553
|
messages: { noStringStyleProp: "Do not use string style prop. Use an object instead." },
|
|
602
554
|
schema: []
|
|
603
555
|
},
|
|
@@ -1651,7 +1603,7 @@ const messages = {
|
|
|
1651
1603
|
var no_unknown_property_default = createRule({
|
|
1652
1604
|
meta: {
|
|
1653
1605
|
type: "problem",
|
|
1654
|
-
docs: { description: "Disallow unknown
|
|
1606
|
+
docs: { description: "Disallow unknown 'DOM' property." },
|
|
1655
1607
|
fixable: "code",
|
|
1656
1608
|
messages,
|
|
1657
1609
|
schema: [{
|
|
@@ -1755,7 +1707,6 @@ function create$5(context) {
|
|
|
1755
1707
|
//#endregion
|
|
1756
1708
|
//#region src/rules/no-unsafe-iframe-sandbox.ts
|
|
1757
1709
|
const RULE_NAME$4 = "no-unsafe-iframe-sandbox";
|
|
1758
|
-
const RULE_FEATURES$4 = [];
|
|
1759
1710
|
const UNSAFE_SANDBOX_VALUES = ["allow-scripts", "allow-same-origin"];
|
|
1760
1711
|
/**
|
|
1761
1712
|
* Checks if the sandbox attribute value contains an unsafe combination
|
|
@@ -1771,10 +1722,7 @@ function isUnsafeSandboxCombination(value) {
|
|
|
1771
1722
|
var no_unsafe_iframe_sandbox_default = createRule({
|
|
1772
1723
|
meta: {
|
|
1773
1724
|
type: "problem",
|
|
1774
|
-
docs: {
|
|
1775
|
-
description: "Enforces `sandbox` attribute for `iframe` elements is not set to unsafe combinations.",
|
|
1776
|
-
[Symbol.for("rule_features")]: RULE_FEATURES$4
|
|
1777
|
-
},
|
|
1725
|
+
docs: { description: "Enforces 'sandbox' attribute for 'iframe' elements is not set to unsafe combinations." },
|
|
1778
1726
|
messages: { noUnsafeIframeSandbox: "Unsafe 'sandbox' attribute value on 'iframe' component." },
|
|
1779
1727
|
schema: []
|
|
1780
1728
|
},
|
|
@@ -1799,7 +1747,6 @@ function create$4(context) {
|
|
|
1799
1747
|
//#endregion
|
|
1800
1748
|
//#region src/rules/no-unsafe-target-blank.ts
|
|
1801
1749
|
const RULE_NAME$3 = "no-unsafe-target-blank";
|
|
1802
|
-
const RULE_FEATURES$3 = ["FIX"];
|
|
1803
1750
|
/**
|
|
1804
1751
|
* Checks if a value appears to be an external link.
|
|
1805
1752
|
* External links typically start with http(s):// or have protocol-relative format.
|
|
@@ -1823,10 +1770,7 @@ function isSafeRel(value) {
|
|
|
1823
1770
|
var no_unsafe_target_blank_default = createRule({
|
|
1824
1771
|
meta: {
|
|
1825
1772
|
type: "problem",
|
|
1826
|
-
docs: {
|
|
1827
|
-
description: "Disallow `target=\"_blank\"` without `rel=\"noreferrer noopener\"`.",
|
|
1828
|
-
[Symbol.for("rule_features")]: RULE_FEATURES$3
|
|
1829
|
-
},
|
|
1773
|
+
docs: { description: "Disallow 'target=\"_blank\"' without 'rel=\"noreferrer noopener\"'." },
|
|
1830
1774
|
fixable: "code",
|
|
1831
1775
|
hasSuggestions: true,
|
|
1832
1776
|
messages: {
|
|
@@ -1882,14 +1826,10 @@ function create$3(context) {
|
|
|
1882
1826
|
//#endregion
|
|
1883
1827
|
//#region src/rules/no-use-form-state.ts
|
|
1884
1828
|
const RULE_NAME$2 = "no-use-form-state";
|
|
1885
|
-
const RULE_FEATURES$2 = ["MOD"];
|
|
1886
1829
|
var no_use_form_state_default = createRule({
|
|
1887
1830
|
meta: {
|
|
1888
1831
|
type: "problem",
|
|
1889
|
-
docs: {
|
|
1890
|
-
description: "Replaces usages of `useFormState` with `useActionState`.",
|
|
1891
|
-
[Symbol.for("rule_features")]: RULE_FEATURES$2
|
|
1892
|
-
},
|
|
1832
|
+
docs: { description: "Replaces usages of 'useFormState' with 'useActionState'." },
|
|
1893
1833
|
fixable: "code",
|
|
1894
1834
|
messages: { noUseFormState: "[Deprecated] Use 'useActionState' from 'react' package instead." },
|
|
1895
1835
|
schema: []
|
|
@@ -1948,7 +1888,6 @@ function getFix(context, node) {
|
|
|
1948
1888
|
//#endregion
|
|
1949
1889
|
//#region src/rules/no-void-elements-with-children.ts
|
|
1950
1890
|
const RULE_NAME$1 = "no-void-elements-with-children";
|
|
1951
|
-
const RULE_FEATURES$1 = [];
|
|
1952
1891
|
const voidElements = new Set([
|
|
1953
1892
|
"area",
|
|
1954
1893
|
"base",
|
|
@@ -1970,10 +1909,7 @@ const voidElements = new Set([
|
|
|
1970
1909
|
var no_void_elements_with_children_default = createRule({
|
|
1971
1910
|
meta: {
|
|
1972
1911
|
type: "problem",
|
|
1973
|
-
docs: {
|
|
1974
|
-
description: "Disallow `children` in void DOM elements.",
|
|
1975
|
-
[Symbol.for("rule_features")]: RULE_FEATURES$1
|
|
1976
|
-
},
|
|
1912
|
+
docs: { description: "Disallow 'children' in void DOM elements." },
|
|
1977
1913
|
messages: { noVoidElementsWithChildren: "'{{elementType}}' is a void element tag and must not have children." },
|
|
1978
1914
|
schema: []
|
|
1979
1915
|
},
|
|
@@ -2000,14 +1936,10 @@ function create$1(context) {
|
|
|
2000
1936
|
//#endregion
|
|
2001
1937
|
//#region src/rules/prefer-namespace-import.ts
|
|
2002
1938
|
const RULE_NAME = "prefer-namespace-import";
|
|
2003
|
-
const RULE_FEATURES = ["FIX"];
|
|
2004
1939
|
var prefer_namespace_import_default = createRule({
|
|
2005
1940
|
meta: {
|
|
2006
1941
|
type: "problem",
|
|
2007
|
-
docs: {
|
|
2008
|
-
description: "Enforces React Dom is imported via a namespace import.",
|
|
2009
|
-
[Symbol.for("rule_features")]: RULE_FEATURES
|
|
2010
|
-
},
|
|
1942
|
+
docs: { description: "Enforces React DOM is imported via a namespace import." },
|
|
2011
1943
|
fixable: "code",
|
|
2012
1944
|
messages: { preferNamespaceImport: "Prefer importing React DOM via a namespace import." },
|
|
2013
1945
|
schema: []
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-dom",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1-beta.0",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for React DOM related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -38,22 +38,22 @@
|
|
|
38
38
|
"./package.json"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@typescript-eslint/scope-manager": "^8.50.
|
|
42
|
-
"@typescript-eslint/types": "^8.50.
|
|
43
|
-
"@typescript-eslint/utils": "^8.50.
|
|
41
|
+
"@typescript-eslint/scope-manager": "^8.50.1",
|
|
42
|
+
"@typescript-eslint/types": "^8.50.1",
|
|
43
|
+
"@typescript-eslint/utils": "^8.50.1",
|
|
44
44
|
"compare-versions": "^6.1.1",
|
|
45
45
|
"string-ts": "^2.3.1",
|
|
46
46
|
"ts-pattern": "^5.9.0",
|
|
47
|
-
"@eslint-react/
|
|
48
|
-
"@eslint-react/
|
|
49
|
-
"@eslint-react/eff": "2.4.
|
|
50
|
-
"@eslint-react/shared": "2.4.
|
|
51
|
-
"@eslint-react/var": "2.4.
|
|
47
|
+
"@eslint-react/core": "2.4.1-beta.0",
|
|
48
|
+
"@eslint-react/ast": "2.4.1-beta.0",
|
|
49
|
+
"@eslint-react/eff": "2.4.1-beta.0",
|
|
50
|
+
"@eslint-react/shared": "2.4.1-beta.0",
|
|
51
|
+
"@eslint-react/var": "2.4.1-beta.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/react": "^19.2.7",
|
|
55
55
|
"@types/react-dom": "^19.2.3",
|
|
56
|
-
"tsdown": "^0.18.
|
|
56
|
+
"tsdown": "^0.18.2",
|
|
57
57
|
"@local/configs": "0.0.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|