eslint-plugin-react-dom 5.28.7 → 5.30.0-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.d.ts +0 -2
- package/dist/index.js +21 -43
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DEFAULT_ESLINT_REACT_SETTINGS, RE_JAVASCRIPT_PROTOCOL, getSettingsFromContext } from "@eslint-react/shared";
|
|
2
2
|
import * as ESLintUtils from "@typescript-eslint/utils/eslint-utils";
|
|
3
|
-
import "@eslint-react/eslint";
|
|
3
|
+
import { getText } from "@eslint-react/eslint";
|
|
4
4
|
import { findAttribute, getAttributeStaticValue, getElementFullType, hasAnyAttribute, hasAttribute, isAttribute, isHostElement, isPaddingWhitespace, resolveAttributeValue } from "@eslint-react/jsx";
|
|
5
5
|
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
|
-
|
|
9
|
+
// \0rolldown/runtime.js
|
|
10
10
|
var __defProp = Object.defineProperty;
|
|
11
11
|
var __exportAll = (all, no_symbols) => {
|
|
12
12
|
let target = {};
|
|
@@ -17,12 +17,10 @@ var __exportAll = (all, no_symbols) => {
|
|
|
17
17
|
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
18
18
|
return target;
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
//#region package.json
|
|
20
|
+
// package.json
|
|
22
21
|
var name$2 = "eslint-plugin-react-dom";
|
|
23
|
-
var version = "5.
|
|
24
|
-
|
|
25
|
-
//#region src/utils/create-rule.ts
|
|
22
|
+
var version = "5.30.0-beta.0";
|
|
23
|
+
// src/utils/create-rule.ts
|
|
26
24
|
function getDocsUrl(ruleName) {
|
|
27
25
|
return `https://eslint-react.xyz/docs/rules/dom-${ruleName}`;
|
|
28
26
|
}
|
|
@@ -172,15 +170,13 @@ function create$11(context) {
|
|
|
172
170
|
} };
|
|
173
171
|
}
|
|
174
172
|
function buildFix$2(context, node) {
|
|
175
|
-
const getText = (n) => context.sourceCode.getText(n);
|
|
176
173
|
return (fixer) => {
|
|
177
174
|
const [arg0, arg1] = node.arguments;
|
|
178
175
|
if (arg0 == null || arg1 == null) return null;
|
|
179
|
-
return [fixer.insertTextBefore(context.sourceCode.ast, "import { hydrateRoot } from \"react-dom/client\";\n"), fixer.replaceText(node, `hydrateRoot(${getText(arg1)}, ${getText(arg0)})`)];
|
|
176
|
+
return [fixer.insertTextBefore(context.sourceCode.ast, "import { hydrateRoot } from \"react-dom/client\";\n"), fixer.replaceText(node, `hydrateRoot(${getText(context, arg1)}, ${getText(context, arg0)})`)];
|
|
180
177
|
};
|
|
181
178
|
}
|
|
182
|
-
|
|
183
|
-
//#region ../../.pkgs/eff/dist/index.js
|
|
179
|
+
// ../../.pkgs/eff/dist/index.js
|
|
184
180
|
const pipeArguments = (self, args) => {
|
|
185
181
|
switch (args.length) {
|
|
186
182
|
case 0: return self;
|
|
@@ -274,8 +270,7 @@ dual(2, (self, predicate) => {
|
|
|
274
270
|
while (idx < len && predicate(input[idx], idx)) idx++;
|
|
275
271
|
return input.slice(0, idx);
|
|
276
272
|
});
|
|
277
|
-
|
|
278
|
-
//#region src/utils/create-jsx-element-resolver.ts
|
|
273
|
+
// src/utils/create-jsx-element-resolver.ts
|
|
279
274
|
function createJSXElementResolver(context) {
|
|
280
275
|
const { polymorphicPropName } = getSettingsFromContext(context);
|
|
281
276
|
return { resolve(node) {
|
|
@@ -294,8 +289,7 @@ function createJSXElementResolver(context) {
|
|
|
294
289
|
return result;
|
|
295
290
|
} };
|
|
296
291
|
}
|
|
297
|
-
|
|
298
|
-
//#region src/rules/no-missing-button-type/no-missing-button-type.ts
|
|
292
|
+
// src/rules/no-missing-button-type/no-missing-button-type.ts
|
|
299
293
|
const RULE_NAME$10 = "no-missing-button-type";
|
|
300
294
|
const BUTTON_TYPES = [
|
|
301
295
|
"button",
|
|
@@ -386,8 +380,7 @@ function create$9(context) {
|
|
|
386
380
|
});
|
|
387
381
|
} };
|
|
388
382
|
}
|
|
389
|
-
|
|
390
|
-
//#region src/rules/no-render-return-value/no-render-return-value.ts
|
|
383
|
+
// src/rules/no-render-return-value/no-render-return-value.ts
|
|
391
384
|
const RULE_NAME$8 = "no-render-return-value";
|
|
392
385
|
const BANNED_PARENT_TYPES = [
|
|
393
386
|
AST_NODE_TYPES.VariableDeclarator,
|
|
@@ -475,11 +468,10 @@ function create$7(context) {
|
|
|
475
468
|
} };
|
|
476
469
|
}
|
|
477
470
|
function buildFix$1(context, node) {
|
|
478
|
-
const getText = (n) => context.sourceCode.getText(n);
|
|
479
471
|
return (fixer) => {
|
|
480
472
|
const [arg0, arg1] = node.arguments;
|
|
481
473
|
if (arg0 == null || arg1 == null) return null;
|
|
482
|
-
return [fixer.insertTextBefore(context.sourceCode.ast, "import { createRoot } from \"react-dom/client\";\n"), fixer.replaceText(node, `createRoot(${getText(arg1)}).render(${getText(arg0)})`)];
|
|
474
|
+
return [fixer.insertTextBefore(context.sourceCode.ast, "import { createRoot } from \"react-dom/client\";\n"), fixer.replaceText(node, `createRoot(${getText(context, arg1)}).render(${getText(context, arg0)})`)];
|
|
483
475
|
};
|
|
484
476
|
}
|
|
485
477
|
var no_script_url_default = createRule({
|
|
@@ -525,8 +517,7 @@ function create$5(context) {
|
|
|
525
517
|
});
|
|
526
518
|
} };
|
|
527
519
|
}
|
|
528
|
-
|
|
529
|
-
//#region src/rules/no-unknown-property/lib.ts
|
|
520
|
+
// src/rules/no-unknown-property/lib.ts
|
|
530
521
|
const DOM_ATTRIBUTE_NAMES = {
|
|
531
522
|
"accept-charset": "acceptCharset",
|
|
532
523
|
class: "className",
|
|
@@ -1492,11 +1483,7 @@ function getStandardName(name, context) {
|
|
|
1492
1483
|
if (has(svgAttributeNames, name)) return svgAttributeNames[name] ?? null;
|
|
1493
1484
|
return getDOMPropertyNames(context).find((element) => element.toLowerCase() === name.toLowerCase()) ?? null;
|
|
1494
1485
|
}
|
|
1495
|
-
|
|
1496
|
-
return context.sourceCode.getText(node);
|
|
1497
|
-
}
|
|
1498
|
-
//#endregion
|
|
1499
|
-
//#region src/rules/no-unknown-property/no-unknown-property.ts
|
|
1486
|
+
// src/rules/no-unknown-property/no-unknown-property.ts
|
|
1500
1487
|
const RULE_NAME$4 = "no-unknown-property";
|
|
1501
1488
|
const DEFAULTS = {
|
|
1502
1489
|
ignore: [],
|
|
@@ -1599,8 +1586,7 @@ function create$4(context) {
|
|
|
1599
1586
|
});
|
|
1600
1587
|
} };
|
|
1601
1588
|
}
|
|
1602
|
-
|
|
1603
|
-
//#region src/rules/no-unsafe-iframe-sandbox/no-unsafe-iframe-sandbox.ts
|
|
1589
|
+
// src/rules/no-unsafe-iframe-sandbox/no-unsafe-iframe-sandbox.ts
|
|
1604
1590
|
const RULE_NAME$3 = "no-unsafe-iframe-sandbox";
|
|
1605
1591
|
const UNSAFE_SANDBOX_VALUES = ["allow-scripts", "allow-same-origin"];
|
|
1606
1592
|
var no_unsafe_iframe_sandbox_default = createRule({
|
|
@@ -1629,8 +1615,7 @@ function create$3(context) {
|
|
|
1629
1615
|
});
|
|
1630
1616
|
} };
|
|
1631
1617
|
}
|
|
1632
|
-
|
|
1633
|
-
//#region src/rules/no-unsafe-target-blank/lib.ts
|
|
1618
|
+
// src/rules/no-unsafe-target-blank/lib.ts
|
|
1634
1619
|
function isExternalLinkLike(value) {
|
|
1635
1620
|
if (!isString(value)) return false;
|
|
1636
1621
|
return value.startsWith("https://") || /^(?:\w+:|\/\/)/u.test(value);
|
|
@@ -1640,8 +1625,7 @@ function isSafeRel(value, allowReferrer) {
|
|
|
1640
1625
|
if (/\bnoreferrer\b/u.test(value)) return true;
|
|
1641
1626
|
return allowReferrer && /\bnoopener\b/u.test(value);
|
|
1642
1627
|
}
|
|
1643
|
-
|
|
1644
|
-
//#region src/rules/no-unsafe-target-blank/no-unsafe-target-blank.ts
|
|
1628
|
+
// src/rules/no-unsafe-target-blank/no-unsafe-target-blank.ts
|
|
1645
1629
|
const RULE_NAME$2 = "no-unsafe-target-blank";
|
|
1646
1630
|
const defaultOptions = [{ allowReferrer: false }];
|
|
1647
1631
|
const schema = [{
|
|
@@ -1746,8 +1730,7 @@ function buildFix(context, node) {
|
|
|
1746
1730
|
return [fixer.insertTextBefore(context.sourceCode.ast, `import { useActionState } from "${importSource}";\n`), fixer.replaceText(node.callee, "useActionState")];
|
|
1747
1731
|
};
|
|
1748
1732
|
}
|
|
1749
|
-
|
|
1750
|
-
//#region src/rules/no-void-elements-with-children/lib.ts
|
|
1733
|
+
// src/rules/no-void-elements-with-children/lib.ts
|
|
1751
1734
|
const KNOWN_VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
|
1752
1735
|
"area",
|
|
1753
1736
|
"base",
|
|
@@ -1788,8 +1771,7 @@ function create(context) {
|
|
|
1788
1771
|
});
|
|
1789
1772
|
} };
|
|
1790
1773
|
}
|
|
1791
|
-
|
|
1792
|
-
//#region src/plugin.ts
|
|
1774
|
+
// src/plugin.ts
|
|
1793
1775
|
const plugin = {
|
|
1794
1776
|
meta: {
|
|
1795
1777
|
name: name$2,
|
|
@@ -1814,8 +1796,7 @@ const plugin = {
|
|
|
1814
1796
|
"no-void-elements-with-children": no_void_elements_with_children_default
|
|
1815
1797
|
}
|
|
1816
1798
|
};
|
|
1817
|
-
|
|
1818
|
-
//#region src/configs/recommended.ts
|
|
1799
|
+
// src/configs/recommended.ts
|
|
1819
1800
|
var recommended_exports = /* @__PURE__ */ __exportAll({
|
|
1820
1801
|
name: () => name$1,
|
|
1821
1802
|
plugins: () => plugins$1,
|
|
@@ -1838,8 +1819,7 @@ const rules$1 = {
|
|
|
1838
1819
|
};
|
|
1839
1820
|
const plugins$1 = { "react-dom": plugin };
|
|
1840
1821
|
const settings$1 = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
1841
|
-
|
|
1842
|
-
//#region src/configs/strict.ts
|
|
1822
|
+
// src/configs/strict.ts
|
|
1843
1823
|
var strict_exports = /* @__PURE__ */ __exportAll({
|
|
1844
1824
|
name: () => name,
|
|
1845
1825
|
plugins: () => plugins,
|
|
@@ -1855,8 +1835,7 @@ const rules = {
|
|
|
1855
1835
|
};
|
|
1856
1836
|
const plugins = { ...plugins$1 };
|
|
1857
1837
|
const settings = { ...settings$1 };
|
|
1858
|
-
|
|
1859
|
-
//#region src/index.ts
|
|
1838
|
+
// src/index.ts
|
|
1860
1839
|
function createConfig(base) {
|
|
1861
1840
|
return {
|
|
1862
1841
|
...base,
|
|
@@ -1875,5 +1854,4 @@ const finalPlugin = {
|
|
|
1875
1854
|
["strict"]: createConfig(strict_exports)
|
|
1876
1855
|
}
|
|
1877
1856
|
};
|
|
1878
|
-
//#endregion
|
|
1879
1857
|
export { finalPlugin as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-dom",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.30.0-beta.0",
|
|
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.
|
|
41
|
-
"@eslint-react/eslint": "5.
|
|
42
|
-
"@eslint-react/jsx": "5.
|
|
43
|
-
"@eslint-react/shared": "5.
|
|
44
|
-
"@eslint-react/var": "5.
|
|
40
|
+
"@eslint-react/ast": "5.30.0-beta.0",
|
|
41
|
+
"@eslint-react/eslint": "5.30.0-beta.0",
|
|
42
|
+
"@eslint-react/jsx": "5.30.0-beta.0",
|
|
43
|
+
"@eslint-react/shared": "5.30.0-beta.0",
|
|
44
|
+
"@eslint-react/var": "5.30.0-beta.0",
|
|
45
45
|
"@typescript-eslint/types": "^8.72.0",
|
|
46
46
|
"@typescript-eslint/utils": "^8.72.0",
|
|
47
47
|
"compare-versions": "^6.1.1",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@types/react-dom": "^19.3.0",
|
|
58
58
|
"dedent": "^1.7.2",
|
|
59
59
|
"eslint": "^10.13.0",
|
|
60
|
-
"tsdown": "^0.23.
|
|
60
|
+
"tsdown": "^0.23.2",
|
|
61
61
|
"typescript": "6.0.3"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|