eslint-plugin-react-dom 1.16.2-next.0 → 1.16.2-next.2
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 +11 -4
- package/dist/index.mjs +9 -2
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -30,8 +30,15 @@ var AST__namespace = /*#__PURE__*/_interopNamespace(AST);
|
|
|
30
30
|
|
|
31
31
|
// package.json
|
|
32
32
|
var name = "eslint-plugin-react-dom";
|
|
33
|
-
var version = "1.16.2-next.
|
|
33
|
+
var version = "1.16.2-next.2";
|
|
34
34
|
var createRule = shared.createRuleForPlugin("dom");
|
|
35
|
+
function findAttrInCustomAttributes(name2, attributes) {
|
|
36
|
+
return tools.F.pipe(
|
|
37
|
+
tools.O.fromNullable(attributes.findLast((a) => a.as === name2)),
|
|
38
|
+
tools.O.map((a) => [a.name, a.defaultValue]),
|
|
39
|
+
tools.O.getOrElse(() => [name2])
|
|
40
|
+
);
|
|
41
|
+
}
|
|
35
42
|
|
|
36
43
|
// src/rules/no-children-in-void-dom-elements.ts
|
|
37
44
|
var RULE_NAME = "no-children-in-void-dom-elements";
|
|
@@ -1535,7 +1542,7 @@ var no_unsafe_target_blank_default = createRule({
|
|
|
1535
1542
|
const [
|
|
1536
1543
|
targetPropName,
|
|
1537
1544
|
targetPropDefaultValue
|
|
1538
|
-
] =
|
|
1545
|
+
] = findAttrInCustomAttributes("target", additionalAttributes);
|
|
1539
1546
|
const targetProp = JSX9__namespace.findPropInAttributes(attributes, initialScope)(targetPropName);
|
|
1540
1547
|
const targetPropValue = tools.O.isNone(targetProp) ? tools.O.fromNullable(targetPropDefaultValue) : tools.F.pipe(
|
|
1541
1548
|
targetProp,
|
|
@@ -1549,7 +1556,7 @@ var no_unsafe_target_blank_default = createRule({
|
|
|
1549
1556
|
const [
|
|
1550
1557
|
hrefPropName,
|
|
1551
1558
|
hrefPropDefaultValue
|
|
1552
|
-
] =
|
|
1559
|
+
] = findAttrInCustomAttributes("href", additionalAttributes);
|
|
1553
1560
|
const hrefProp = JSX9__namespace.findPropInAttributes(attributes, initialScope)(hrefPropName);
|
|
1554
1561
|
const hrefPropValue = tools.O.isNone(hrefProp) ? tools.O.fromNullable(hrefPropDefaultValue) : tools.F.pipe(
|
|
1555
1562
|
hrefProp,
|
|
@@ -1563,7 +1570,7 @@ var no_unsafe_target_blank_default = createRule({
|
|
|
1563
1570
|
const [
|
|
1564
1571
|
relPropName,
|
|
1565
1572
|
relPropDefaultValue
|
|
1566
|
-
] =
|
|
1573
|
+
] = findAttrInCustomAttributes("rel", additionalAttributes);
|
|
1567
1574
|
const relProp = JSX9__namespace.findPropInAttributes(attributes, initialScope)(relPropName);
|
|
1568
1575
|
const relPropValue = tools.O.isNone(relProp) ? tools.O.fromNullable(relPropDefaultValue) : tools.F.pipe(
|
|
1569
1576
|
relProp,
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as JSX9 from '@eslint-react/jsx';
|
|
2
|
-
import { createRuleForPlugin, normalizeSettings, decodeSettings, RE_JAVASCRIPT_PROTOCOL
|
|
2
|
+
import { createRuleForPlugin, normalizeSettings, decodeSettings, RE_JAVASCRIPT_PROTOCOL } from '@eslint-react/shared';
|
|
3
3
|
import { O, F, isString, isNullable } from '@eslint-react/tools';
|
|
4
4
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
5
5
|
import * as AST from '@eslint-react/ast';
|
|
@@ -7,8 +7,15 @@ import { match, P } from 'ts-pattern';
|
|
|
7
7
|
|
|
8
8
|
// package.json
|
|
9
9
|
var name = "eslint-plugin-react-dom";
|
|
10
|
-
var version = "1.16.2-next.
|
|
10
|
+
var version = "1.16.2-next.2";
|
|
11
11
|
var createRule = createRuleForPlugin("dom");
|
|
12
|
+
function findAttrInCustomAttributes(name2, attributes) {
|
|
13
|
+
return F.pipe(
|
|
14
|
+
O.fromNullable(attributes.findLast((a) => a.as === name2)),
|
|
15
|
+
O.map((a) => [a.name, a.defaultValue]),
|
|
16
|
+
O.getOrElse(() => [name2])
|
|
17
|
+
);
|
|
18
|
+
}
|
|
12
19
|
|
|
13
20
|
// src/rules/no-children-in-void-dom-elements.ts
|
|
14
21
|
var RULE_NAME = "no-children-in-void-dom-elements";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-dom",
|
|
3
|
-
"version": "1.16.2-next.
|
|
3
|
+
"version": "1.16.2-next.2",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for React DOM related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"@typescript-eslint/types": "^8.14.0",
|
|
47
47
|
"@typescript-eslint/utils": "^8.14.0",
|
|
48
48
|
"ts-pattern": "^5.5.0",
|
|
49
|
-
"@eslint-react/ast": "1.16.2-next.
|
|
50
|
-
"@eslint-react/
|
|
51
|
-
"@eslint-react/jsx": "1.16.2-next.
|
|
52
|
-
"@eslint-react/
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/
|
|
49
|
+
"@eslint-react/ast": "1.16.2-next.2",
|
|
50
|
+
"@eslint-react/shared": "1.16.2-next.2",
|
|
51
|
+
"@eslint-react/jsx": "1.16.2-next.2",
|
|
52
|
+
"@eslint-react/tools": "1.16.2-next.2",
|
|
53
|
+
"@eslint-react/var": "1.16.2-next.2",
|
|
54
|
+
"@eslint-react/types": "1.16.2-next.2",
|
|
55
|
+
"@eslint-react/core": "1.16.2-next.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/react": "^18.3.12",
|