eslint-plugin-react-x 1.48.2-next.1 → 1.48.3-next.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 +9 -9
- package/dist/index.mjs +9 -9
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -141,7 +141,7 @@ var settings3 = {
|
|
|
141
141
|
|
|
142
142
|
// package.json
|
|
143
143
|
var name4 = "eslint-plugin-react-x";
|
|
144
|
-
var version = "1.48.
|
|
144
|
+
var version = "1.48.3-next.0";
|
|
145
145
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("x"));
|
|
146
146
|
|
|
147
147
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -1453,7 +1453,7 @@ function create27(context) {
|
|
|
1453
1453
|
if (!ER25__namespace.isForwardRefCall(context, node)) {
|
|
1454
1454
|
return;
|
|
1455
1455
|
}
|
|
1456
|
-
const id = AST8__namespace.
|
|
1456
|
+
const id = AST8__namespace.getFunctionId(node);
|
|
1457
1457
|
context.report({
|
|
1458
1458
|
messageId: "noForwardRef",
|
|
1459
1459
|
node: id ?? node,
|
|
@@ -1756,14 +1756,14 @@ function create30(context) {
|
|
|
1756
1756
|
const components = ctx.getAllComponents(program);
|
|
1757
1757
|
for (const { node, displayName, flag } of components.values()) {
|
|
1758
1758
|
const isMemoOrForwardRef = (flag & (ER25__namespace.ComponentFlag.ForwardRef | ER25__namespace.ComponentFlag.Memo)) > 0n;
|
|
1759
|
-
if (AST8__namespace.
|
|
1759
|
+
if (AST8__namespace.getFunctionId(node) != null) {
|
|
1760
1760
|
continue;
|
|
1761
1761
|
}
|
|
1762
1762
|
if (!isMemoOrForwardRef) {
|
|
1763
1763
|
continue;
|
|
1764
1764
|
}
|
|
1765
1765
|
if (displayName == null) {
|
|
1766
|
-
const id = AST8__namespace.
|
|
1766
|
+
const id = AST8__namespace.getFunctionId(node);
|
|
1767
1767
|
context.report({
|
|
1768
1768
|
messageId: "noMissingComponentDisplayName",
|
|
1769
1769
|
node: id ?? node
|
|
@@ -2653,7 +2653,7 @@ function create45(context) {
|
|
|
2653
2653
|
messageId: "unstableContextValue",
|
|
2654
2654
|
node: constructionNode,
|
|
2655
2655
|
data: {
|
|
2656
|
-
type: AST8__namespace.
|
|
2656
|
+
type: AST8__namespace.toDelimiterCaseType(constructionNode),
|
|
2657
2657
|
suggestion
|
|
2658
2658
|
}
|
|
2659
2659
|
});
|
|
@@ -2721,7 +2721,7 @@ function create46(context) {
|
|
|
2721
2721
|
if (ER25__namespace.isReactHookCall(construction.node)) {
|
|
2722
2722
|
continue;
|
|
2723
2723
|
}
|
|
2724
|
-
const forbiddenType = AST8__namespace.
|
|
2724
|
+
const forbiddenType = AST8__namespace.toDelimiterCaseType(right);
|
|
2725
2725
|
context.report({
|
|
2726
2726
|
messageId: "noUnstableDefaultProps",
|
|
2727
2727
|
node: right,
|
|
@@ -2799,7 +2799,7 @@ function create47(context) {
|
|
|
2799
2799
|
if (currentClass == null || !ER25__namespace.isClassComponent(currentClass)) {
|
|
2800
2800
|
return;
|
|
2801
2801
|
}
|
|
2802
|
-
const className = AST8__namespace.
|
|
2802
|
+
const className = AST8__namespace.getClassId(currentClass)?.name;
|
|
2803
2803
|
const defs = propertyDefs.get(currentClass);
|
|
2804
2804
|
const usages = propertyUsages.get(currentClass);
|
|
2805
2805
|
if (defs == null) {
|
|
@@ -2925,7 +2925,7 @@ function create48(context) {
|
|
|
2925
2925
|
if (currentClass == null || !ER25__namespace.isClassComponent(currentClass)) {
|
|
2926
2926
|
return;
|
|
2927
2927
|
}
|
|
2928
|
-
const className = AST8__namespace.
|
|
2928
|
+
const className = AST8__namespace.getClassId(currentClass)?.name;
|
|
2929
2929
|
const { node: defNode, isUsed = false } = stateDefs.get(currentClass) ?? {};
|
|
2930
2930
|
if (defNode == null || isUsed) {
|
|
2931
2931
|
return;
|
|
@@ -3379,7 +3379,7 @@ function create52(context) {
|
|
|
3379
3379
|
if (!AST8__namespace.isFunction(block)) {
|
|
3380
3380
|
return false;
|
|
3381
3381
|
}
|
|
3382
|
-
const id = AST8__namespace.
|
|
3382
|
+
const id = AST8__namespace.getFunctionId(block);
|
|
3383
3383
|
return id != null && ER25__namespace.isComponentNameLoose(id.name) && components.some((component) => component.node === block);
|
|
3384
3384
|
}
|
|
3385
3385
|
for (const [initialScope, memberExpression] of memberExpressionWithNames) {
|
package/dist/index.mjs
CHANGED
|
@@ -114,7 +114,7 @@ var settings3 = {
|
|
|
114
114
|
|
|
115
115
|
// package.json
|
|
116
116
|
var name4 = "eslint-plugin-react-x";
|
|
117
|
-
var version = "1.48.
|
|
117
|
+
var version = "1.48.3-next.0";
|
|
118
118
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("x"));
|
|
119
119
|
|
|
120
120
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -1426,7 +1426,7 @@ function create27(context) {
|
|
|
1426
1426
|
if (!ER25.isForwardRefCall(context, node)) {
|
|
1427
1427
|
return;
|
|
1428
1428
|
}
|
|
1429
|
-
const id = AST8.
|
|
1429
|
+
const id = AST8.getFunctionId(node);
|
|
1430
1430
|
context.report({
|
|
1431
1431
|
messageId: "noForwardRef",
|
|
1432
1432
|
node: id ?? node,
|
|
@@ -1729,14 +1729,14 @@ function create30(context) {
|
|
|
1729
1729
|
const components = ctx.getAllComponents(program);
|
|
1730
1730
|
for (const { node, displayName, flag } of components.values()) {
|
|
1731
1731
|
const isMemoOrForwardRef = (flag & (ER25.ComponentFlag.ForwardRef | ER25.ComponentFlag.Memo)) > 0n;
|
|
1732
|
-
if (AST8.
|
|
1732
|
+
if (AST8.getFunctionId(node) != null) {
|
|
1733
1733
|
continue;
|
|
1734
1734
|
}
|
|
1735
1735
|
if (!isMemoOrForwardRef) {
|
|
1736
1736
|
continue;
|
|
1737
1737
|
}
|
|
1738
1738
|
if (displayName == null) {
|
|
1739
|
-
const id = AST8.
|
|
1739
|
+
const id = AST8.getFunctionId(node);
|
|
1740
1740
|
context.report({
|
|
1741
1741
|
messageId: "noMissingComponentDisplayName",
|
|
1742
1742
|
node: id ?? node
|
|
@@ -2626,7 +2626,7 @@ function create45(context) {
|
|
|
2626
2626
|
messageId: "unstableContextValue",
|
|
2627
2627
|
node: constructionNode,
|
|
2628
2628
|
data: {
|
|
2629
|
-
type: AST8.
|
|
2629
|
+
type: AST8.toDelimiterCaseType(constructionNode),
|
|
2630
2630
|
suggestion
|
|
2631
2631
|
}
|
|
2632
2632
|
});
|
|
@@ -2694,7 +2694,7 @@ function create46(context) {
|
|
|
2694
2694
|
if (ER25.isReactHookCall(construction.node)) {
|
|
2695
2695
|
continue;
|
|
2696
2696
|
}
|
|
2697
|
-
const forbiddenType = AST8.
|
|
2697
|
+
const forbiddenType = AST8.toDelimiterCaseType(right);
|
|
2698
2698
|
context.report({
|
|
2699
2699
|
messageId: "noUnstableDefaultProps",
|
|
2700
2700
|
node: right,
|
|
@@ -2772,7 +2772,7 @@ function create47(context) {
|
|
|
2772
2772
|
if (currentClass == null || !ER25.isClassComponent(currentClass)) {
|
|
2773
2773
|
return;
|
|
2774
2774
|
}
|
|
2775
|
-
const className = AST8.
|
|
2775
|
+
const className = AST8.getClassId(currentClass)?.name;
|
|
2776
2776
|
const defs = propertyDefs.get(currentClass);
|
|
2777
2777
|
const usages = propertyUsages.get(currentClass);
|
|
2778
2778
|
if (defs == null) {
|
|
@@ -2898,7 +2898,7 @@ function create48(context) {
|
|
|
2898
2898
|
if (currentClass == null || !ER25.isClassComponent(currentClass)) {
|
|
2899
2899
|
return;
|
|
2900
2900
|
}
|
|
2901
|
-
const className = AST8.
|
|
2901
|
+
const className = AST8.getClassId(currentClass)?.name;
|
|
2902
2902
|
const { node: defNode, isUsed = false } = stateDefs.get(currentClass) ?? {};
|
|
2903
2903
|
if (defNode == null || isUsed) {
|
|
2904
2904
|
return;
|
|
@@ -3352,7 +3352,7 @@ function create52(context) {
|
|
|
3352
3352
|
if (!AST8.isFunction(block)) {
|
|
3353
3353
|
return false;
|
|
3354
3354
|
}
|
|
3355
|
-
const id = AST8.
|
|
3355
|
+
const id = AST8.getFunctionId(block);
|
|
3356
3356
|
return id != null && ER25.isComponentNameLoose(id.name) && components.some((component) => component.node === block);
|
|
3357
3357
|
}
|
|
3358
3358
|
for (const [initialScope, memberExpression] of memberExpressionWithNames) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.48.
|
|
3
|
+
"version": "1.48.3-next.0",
|
|
4
4
|
"description": "A set of composable ESLint rules for for libraries and frameworks that use React as a UI runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
"is-immutable-type": "^5.0.1",
|
|
51
51
|
"string-ts": "^2.2.1",
|
|
52
52
|
"ts-pattern": "^5.7.0",
|
|
53
|
-
"@eslint-react/ast": "1.48.
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/
|
|
58
|
-
"@eslint-react/var": "1.48.
|
|
53
|
+
"@eslint-react/ast": "1.48.3-next.0",
|
|
54
|
+
"@eslint-react/eff": "1.48.3-next.0",
|
|
55
|
+
"@eslint-react/kit": "1.48.3-next.0",
|
|
56
|
+
"@eslint-react/shared": "1.48.3-next.0",
|
|
57
|
+
"@eslint-react/core": "1.48.3-next.0",
|
|
58
|
+
"@eslint-react/var": "1.48.3-next.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.1.2",
|