eslint-plugin-react-x 1.52.3-beta.9 → 1.52.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/README.md +1 -1
- package/dist/index.js +12 -12
- package/dist/index.mjs +13 -13
- package/package.json +12 -12
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -142,7 +142,7 @@ var settings3 = {
|
|
|
142
142
|
|
|
143
143
|
// package.json
|
|
144
144
|
var name4 = "eslint-plugin-react-x";
|
|
145
|
-
var version = "1.52.3-
|
|
145
|
+
var version = "1.52.3-next.0";
|
|
146
146
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("x"));
|
|
147
147
|
|
|
148
148
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -603,29 +603,29 @@ function isUsingReactChildren(context, node) {
|
|
|
603
603
|
function getMapIndexParamName(context, node) {
|
|
604
604
|
const { callee } = node;
|
|
605
605
|
if (callee.type !== types.AST_NODE_TYPES.MemberExpression) {
|
|
606
|
-
return eff.
|
|
606
|
+
return eff._;
|
|
607
607
|
}
|
|
608
608
|
if (callee.property.type !== types.AST_NODE_TYPES.Identifier) {
|
|
609
|
-
return eff.
|
|
609
|
+
return eff._;
|
|
610
610
|
}
|
|
611
611
|
const { name: name5 } = callee.property;
|
|
612
612
|
const indexPosition = AST8__namespace.getArrayMethodCallbackIndexParamPosition(name5);
|
|
613
613
|
if (indexPosition === -1) {
|
|
614
|
-
return eff.
|
|
614
|
+
return eff._;
|
|
615
615
|
}
|
|
616
616
|
const callbackArg = node.arguments[isUsingReactChildren(context, node) ? 1 : 0];
|
|
617
617
|
if (callbackArg == null) {
|
|
618
|
-
return eff.
|
|
618
|
+
return eff._;
|
|
619
619
|
}
|
|
620
620
|
if (!AST8__namespace.isOneOf([types.AST_NODE_TYPES.ArrowFunctionExpression, types.AST_NODE_TYPES.FunctionExpression])(callbackArg)) {
|
|
621
|
-
return eff.
|
|
621
|
+
return eff._;
|
|
622
622
|
}
|
|
623
623
|
const { params } = callbackArg;
|
|
624
624
|
if (params.length < indexPosition + 1) {
|
|
625
|
-
return eff.
|
|
625
|
+
return eff._;
|
|
626
626
|
}
|
|
627
627
|
const param = params.at(indexPosition);
|
|
628
|
-
return param != null && "name" in param ? param.name : eff.
|
|
628
|
+
return param != null && "name" in param ? param.name : eff._;
|
|
629
629
|
}
|
|
630
630
|
function getIdentifiersFromBinaryExpression(side) {
|
|
631
631
|
if (side.type === types.AST_NODE_TYPES.Identifier) {
|
|
@@ -1750,9 +1750,9 @@ function create31(context) {
|
|
|
1750
1750
|
];
|
|
1751
1751
|
const services = utils.ESLintUtils.getParserServices(context, false);
|
|
1752
1752
|
function getReportDescriptor(node) {
|
|
1753
|
-
if (node == null) return eff.
|
|
1753
|
+
if (node == null) return eff._;
|
|
1754
1754
|
if (AST8__namespace.is(types.AST_NODE_TYPES.JSXExpressionContainer)(node)) return getReportDescriptor(node.expression);
|
|
1755
|
-
if (AST8__namespace.isJSX(node)) return eff.
|
|
1755
|
+
if (AST8__namespace.isJSX(node)) return eff._;
|
|
1756
1756
|
if (AST8__namespace.isTypeExpression(node)) return getReportDescriptor(node.expression);
|
|
1757
1757
|
return tsPattern.match(node).with({ type: types.AST_NODE_TYPES.LogicalExpression, operator: "&&" }, ({ left, right }) => {
|
|
1758
1758
|
const isLeftUnaryNot = left.type === types.AST_NODE_TYPES.UnaryExpression && left.operator === "!";
|
|
@@ -1784,8 +1784,8 @@ function create31(context) {
|
|
|
1784
1784
|
}).with({ type: types.AST_NODE_TYPES.Identifier }, (n) => {
|
|
1785
1785
|
const variable = VAR2__namespace.findVariable(n.name, context.sourceCode.getScope(n));
|
|
1786
1786
|
const variableDefNode = variable?.defs.at(0)?.node;
|
|
1787
|
-
return tsPattern.match(variableDefNode).with({ init: tsPattern.P.select({ type: tsPattern.P.not(types.AST_NODE_TYPES.VariableDeclaration) }) }, getReportDescriptor).otherwise(() => eff.
|
|
1788
|
-
}).otherwise(() => eff.
|
|
1787
|
+
return tsPattern.match(variableDefNode).with({ init: tsPattern.P.select({ type: tsPattern.P.not(types.AST_NODE_TYPES.VariableDeclaration) }) }, getReportDescriptor).otherwise(() => eff._);
|
|
1788
|
+
}).otherwise(() => eff._);
|
|
1789
1789
|
}
|
|
1790
1790
|
return {
|
|
1791
1791
|
JSXExpressionContainer: eff.flow(getReportDescriptor, kit.Reporter.make(context).send)
|
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
|
6
6
|
import * as VAR2 from '@eslint-react/var';
|
|
7
7
|
import { match, isMatching, P } from 'ts-pattern';
|
|
8
8
|
import * as AST8 from '@eslint-react/ast';
|
|
9
|
-
import { flow, getOrElseUpdate, constTrue, constFalse,
|
|
9
|
+
import { flow, getOrElseUpdate, constTrue, constFalse, _ } from '@eslint-react/eff';
|
|
10
10
|
import { compare } from 'compare-versions';
|
|
11
11
|
import { getConstrainedTypeAtLocation, isTypeReadonly } from '@typescript-eslint/type-utils';
|
|
12
12
|
import { unionTypeParts, isTypeFlagSet, isTrueLiteralType, isFalseLiteralType } from 'ts-api-utils';
|
|
@@ -115,7 +115,7 @@ var settings3 = {
|
|
|
115
115
|
|
|
116
116
|
// package.json
|
|
117
117
|
var name4 = "eslint-plugin-react-x";
|
|
118
|
-
var version = "1.52.3-
|
|
118
|
+
var version = "1.52.3-next.0";
|
|
119
119
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("x"));
|
|
120
120
|
|
|
121
121
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -576,29 +576,29 @@ function isUsingReactChildren(context, node) {
|
|
|
576
576
|
function getMapIndexParamName(context, node) {
|
|
577
577
|
const { callee } = node;
|
|
578
578
|
if (callee.type !== AST_NODE_TYPES.MemberExpression) {
|
|
579
|
-
return
|
|
579
|
+
return _;
|
|
580
580
|
}
|
|
581
581
|
if (callee.property.type !== AST_NODE_TYPES.Identifier) {
|
|
582
|
-
return
|
|
582
|
+
return _;
|
|
583
583
|
}
|
|
584
584
|
const { name: name5 } = callee.property;
|
|
585
585
|
const indexPosition = AST8.getArrayMethodCallbackIndexParamPosition(name5);
|
|
586
586
|
if (indexPosition === -1) {
|
|
587
|
-
return
|
|
587
|
+
return _;
|
|
588
588
|
}
|
|
589
589
|
const callbackArg = node.arguments[isUsingReactChildren(context, node) ? 1 : 0];
|
|
590
590
|
if (callbackArg == null) {
|
|
591
|
-
return
|
|
591
|
+
return _;
|
|
592
592
|
}
|
|
593
593
|
if (!AST8.isOneOf([AST_NODE_TYPES.ArrowFunctionExpression, AST_NODE_TYPES.FunctionExpression])(callbackArg)) {
|
|
594
|
-
return
|
|
594
|
+
return _;
|
|
595
595
|
}
|
|
596
596
|
const { params } = callbackArg;
|
|
597
597
|
if (params.length < indexPosition + 1) {
|
|
598
|
-
return
|
|
598
|
+
return _;
|
|
599
599
|
}
|
|
600
600
|
const param = params.at(indexPosition);
|
|
601
|
-
return param != null && "name" in param ? param.name :
|
|
601
|
+
return param != null && "name" in param ? param.name : _;
|
|
602
602
|
}
|
|
603
603
|
function getIdentifiersFromBinaryExpression(side) {
|
|
604
604
|
if (side.type === AST_NODE_TYPES.Identifier) {
|
|
@@ -1723,9 +1723,9 @@ function create31(context) {
|
|
|
1723
1723
|
];
|
|
1724
1724
|
const services = ESLintUtils.getParserServices(context, false);
|
|
1725
1725
|
function getReportDescriptor(node) {
|
|
1726
|
-
if (node == null) return
|
|
1726
|
+
if (node == null) return _;
|
|
1727
1727
|
if (AST8.is(AST_NODE_TYPES.JSXExpressionContainer)(node)) return getReportDescriptor(node.expression);
|
|
1728
|
-
if (AST8.isJSX(node)) return
|
|
1728
|
+
if (AST8.isJSX(node)) return _;
|
|
1729
1729
|
if (AST8.isTypeExpression(node)) return getReportDescriptor(node.expression);
|
|
1730
1730
|
return match(node).with({ type: AST_NODE_TYPES.LogicalExpression, operator: "&&" }, ({ left, right }) => {
|
|
1731
1731
|
const isLeftUnaryNot = left.type === AST_NODE_TYPES.UnaryExpression && left.operator === "!";
|
|
@@ -1757,8 +1757,8 @@ function create31(context) {
|
|
|
1757
1757
|
}).with({ type: AST_NODE_TYPES.Identifier }, (n) => {
|
|
1758
1758
|
const variable = VAR2.findVariable(n.name, context.sourceCode.getScope(n));
|
|
1759
1759
|
const variableDefNode = variable?.defs.at(0)?.node;
|
|
1760
|
-
return match(variableDefNode).with({ init: P.select({ type: P.not(AST_NODE_TYPES.VariableDeclaration) }) }, getReportDescriptor).otherwise(() =>
|
|
1761
|
-
}).otherwise(() =>
|
|
1760
|
+
return match(variableDefNode).with({ init: P.select({ type: P.not(AST_NODE_TYPES.VariableDeclaration) }) }, getReportDescriptor).otherwise(() => _);
|
|
1761
|
+
}).otherwise(() => _);
|
|
1762
1762
|
}
|
|
1763
1763
|
return {
|
|
1764
1764
|
JSXExpressionContainer: flow(getReportDescriptor, Reporter.make(context).send)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.52.3-
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.52.3-next.0",
|
|
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",
|
|
7
7
|
"eslint",
|
|
@@ -42,20 +42,20 @@
|
|
|
42
42
|
"./package.json"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
46
|
-
"@typescript-eslint/type-utils": "^8.
|
|
47
|
-
"@typescript-eslint/types": "^8.
|
|
48
|
-
"@typescript-eslint/utils": "^8.
|
|
45
|
+
"@typescript-eslint/scope-manager": "^8.34.0",
|
|
46
|
+
"@typescript-eslint/type-utils": "^8.34.0",
|
|
47
|
+
"@typescript-eslint/types": "^8.34.0",
|
|
48
|
+
"@typescript-eslint/utils": "^8.34.0",
|
|
49
49
|
"compare-versions": "^6.1.1",
|
|
50
50
|
"is-immutable-type": "^5.0.1",
|
|
51
51
|
"string-ts": "^2.2.1",
|
|
52
52
|
"ts-pattern": "^5.7.1",
|
|
53
|
-
"@eslint-react/ast": "1.52.3-
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/
|
|
58
|
-
"@eslint-react/
|
|
53
|
+
"@eslint-react/ast": "1.52.3-next.0",
|
|
54
|
+
"@eslint-react/eff": "1.52.3-next.0",
|
|
55
|
+
"@eslint-react/shared": "1.52.3-next.0",
|
|
56
|
+
"@eslint-react/var": "1.52.3-next.0",
|
|
57
|
+
"@eslint-react/core": "1.52.3-next.0",
|
|
58
|
+
"@eslint-react/kit": "1.52.3-next.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.1.8",
|