eslint-plugin-react-x 5.0.2-next.0 → 5.0.2-next.4
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 +47 -5
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_ESLINT_REACT_SETTINGS, defineRuleListener, getSettingsFromContext,
|
|
1
|
+
import { DEFAULT_ESLINT_REACT_SETTINGS, defineRuleListener, getSettingsFromContext, toRegExp } from "@eslint-react/shared";
|
|
2
2
|
import * as ast from "@eslint-react/ast";
|
|
3
3
|
import * as core from "@eslint-react/core";
|
|
4
4
|
import { isUseRefCall } from "@eslint-react/core";
|
|
@@ -141,7 +141,7 @@ const rules$7 = {
|
|
|
141
141
|
//#endregion
|
|
142
142
|
//#region package.json
|
|
143
143
|
var name$6 = "eslint-plugin-react-x";
|
|
144
|
-
var version = "5.0.2-next.
|
|
144
|
+
var version = "5.0.2-next.4";
|
|
145
145
|
|
|
146
146
|
//#endregion
|
|
147
147
|
//#region src/rules/component-hook-factories/lib.ts
|
|
@@ -1647,6 +1647,20 @@ function create$45(context) {
|
|
|
1647
1647
|
});
|
|
1648
1648
|
}
|
|
1649
1649
|
|
|
1650
|
+
//#endregion
|
|
1651
|
+
//#region src/rules/no-array-index-key/lib.ts
|
|
1652
|
+
/**
|
|
1653
|
+
* Creates a report function for the given rule context.
|
|
1654
|
+
* @param context The ESLint rule context.
|
|
1655
|
+
* @returns A function that can be used to report violations.
|
|
1656
|
+
*/
|
|
1657
|
+
function report$2(context) {
|
|
1658
|
+
return (descriptor) => {
|
|
1659
|
+
if (descriptor == null) return;
|
|
1660
|
+
return context.report(descriptor);
|
|
1661
|
+
};
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1650
1664
|
//#endregion
|
|
1651
1665
|
//#region src/rules/no-array-index-key/no-array-index-key.ts
|
|
1652
1666
|
const RULE_NAME$44 = "no-array-index-key";
|
|
@@ -1747,7 +1761,7 @@ function create$44(context) {
|
|
|
1747
1761
|
for (const prop of props.properties) {
|
|
1748
1762
|
if (!isMatching({ key: { name: "key" } })(prop)) continue;
|
|
1749
1763
|
if (!("value" in prop)) continue;
|
|
1750
|
-
for (const descriptor of getReportDescriptors(prop.value)) report(context)(descriptor);
|
|
1764
|
+
for (const descriptor of getReportDescriptors(prop.value)) report$2(context)(descriptor);
|
|
1751
1765
|
}
|
|
1752
1766
|
},
|
|
1753
1767
|
"CallExpression:exit"() {
|
|
@@ -1757,7 +1771,7 @@ function create$44(context) {
|
|
|
1757
1771
|
if (node.name.name !== "key") return;
|
|
1758
1772
|
if (indexParamNames.length === 0) return;
|
|
1759
1773
|
if (node.value?.type !== AST_NODE_TYPES.JSXExpressionContainer) return;
|
|
1760
|
-
for (const descriptor of getReportDescriptors(node.value.expression)) report(context)(descriptor);
|
|
1774
|
+
for (const descriptor of getReportDescriptors(node.value.expression)) report$2(context)(descriptor);
|
|
1761
1775
|
}
|
|
1762
1776
|
});
|
|
1763
1777
|
}
|
|
@@ -2425,6 +2439,20 @@ function create$26(context) {
|
|
|
2425
2439
|
} });
|
|
2426
2440
|
}
|
|
2427
2441
|
|
|
2442
|
+
//#endregion
|
|
2443
|
+
//#region src/rules/no-leaked-conditional-rendering/lib.ts
|
|
2444
|
+
/**
|
|
2445
|
+
* Creates a report function for the given rule context.
|
|
2446
|
+
* @param context The ESLint rule context.
|
|
2447
|
+
* @returns A function that can be used to report violations.
|
|
2448
|
+
*/
|
|
2449
|
+
function report$1(context) {
|
|
2450
|
+
return (descriptor) => {
|
|
2451
|
+
if (descriptor == null) return;
|
|
2452
|
+
return context.report(descriptor);
|
|
2453
|
+
};
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2428
2456
|
//#endregion
|
|
2429
2457
|
//#region src/rules/no-leaked-conditional-rendering/no-leaked-conditional-rendering.ts
|
|
2430
2458
|
const RULE_NAME$25 = "no-leaked-conditional-rendering";
|
|
@@ -2492,7 +2520,7 @@ function create$25(context) {
|
|
|
2492
2520
|
return match(variableDefNode).with({ init: P.select({ type: P.not(AST_NODE_TYPES.VariableDeclaration) }) }, getReportDescriptor).otherwise(() => null);
|
|
2493
2521
|
}).otherwise(() => null);
|
|
2494
2522
|
}
|
|
2495
|
-
return defineRuleListener({ JSXExpressionContainer: flow(getReportDescriptor, report(context)) });
|
|
2523
|
+
return defineRuleListener({ JSXExpressionContainer: flow(getReportDescriptor, report$1(context)) });
|
|
2496
2524
|
}
|
|
2497
2525
|
|
|
2498
2526
|
//#endregion
|
|
@@ -2594,6 +2622,20 @@ function create$23(context) {
|
|
|
2594
2622
|
});
|
|
2595
2623
|
}
|
|
2596
2624
|
|
|
2625
|
+
//#endregion
|
|
2626
|
+
//#region src/rules/no-missing-key/lib.ts
|
|
2627
|
+
/**
|
|
2628
|
+
* Creates a report function for the given rule context.
|
|
2629
|
+
* @param context The ESLint rule context.
|
|
2630
|
+
* @returns A function that can be used to report violations.
|
|
2631
|
+
*/
|
|
2632
|
+
function report(context) {
|
|
2633
|
+
return (descriptor) => {
|
|
2634
|
+
if (descriptor == null) return;
|
|
2635
|
+
return context.report(descriptor);
|
|
2636
|
+
};
|
|
2637
|
+
}
|
|
2638
|
+
|
|
2597
2639
|
//#endregion
|
|
2598
2640
|
//#region src/rules/no-missing-key/no-missing-key.ts
|
|
2599
2641
|
const RULE_NAME$22 = "no-missing-key";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "5.0.2-next.
|
|
3
|
+
"version": "5.0.2-next.4",
|
|
4
4
|
"description": "A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -45,23 +45,23 @@
|
|
|
45
45
|
"string-ts": "^2.3.1",
|
|
46
46
|
"ts-api-utils": "^2.5.0",
|
|
47
47
|
"ts-pattern": "^5.9.0",
|
|
48
|
-
"@eslint-react/ast": "5.0.2-next.
|
|
49
|
-
"@eslint-react/
|
|
50
|
-
"@eslint-react/
|
|
51
|
-
"@eslint-react/
|
|
52
|
-
"@eslint-react/
|
|
48
|
+
"@eslint-react/ast": "5.0.2-next.4",
|
|
49
|
+
"@eslint-react/jsx": "5.0.2-next.4",
|
|
50
|
+
"@eslint-react/core": "5.0.2-next.4",
|
|
51
|
+
"@eslint-react/shared": "5.0.2-next.4",
|
|
52
|
+
"@eslint-react/var": "5.0.2-next.4"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/react": "^19.2.14",
|
|
56
56
|
"@types/react-dom": "^19.2.3",
|
|
57
57
|
"eslint": "^10.2.0",
|
|
58
58
|
"tsdown": "^0.21.7",
|
|
59
|
-
"tsl-dx": "^0.10.
|
|
59
|
+
"tsl-dx": "^0.10.3",
|
|
60
60
|
"@local/configs": "0.0.0",
|
|
61
61
|
"@local/eff": "3.0.0-beta.72"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"eslint": "^10.
|
|
64
|
+
"eslint": "^10.2.0",
|
|
65
65
|
"typescript": "*"
|
|
66
66
|
},
|
|
67
67
|
"engines": {
|