eslint-plugin-react-x 1.23.3-next.6 → 1.23.3-next.7
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 +5 -5
- package/dist/index.mjs +5 -5
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -42,7 +42,7 @@ var ts__default = /*#__PURE__*/_interopDefault(ts);
|
|
|
42
42
|
|
|
43
43
|
// package.json
|
|
44
44
|
var name = "eslint-plugin-react-x";
|
|
45
|
-
var version = "1.23.3-next.
|
|
45
|
+
var version = "1.23.3-next.7";
|
|
46
46
|
var createRule = shared.createRuleForPlugin("x");
|
|
47
47
|
|
|
48
48
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -1600,12 +1600,12 @@ var no_leaked_conditional_rendering_default = createRule({
|
|
|
1600
1600
|
const services = utils.ESLintUtils.getParserServices(context, false);
|
|
1601
1601
|
function getReportDescriptor(node) {
|
|
1602
1602
|
return tsPattern.match(node).when(AST11__namespace.isJSX, eff.O.none).with({ type: types.AST_NODE_TYPES.LogicalExpression, operator: "&&" }, ({ left, right }) => {
|
|
1603
|
-
const isLeftUnaryNot =
|
|
1603
|
+
const isLeftUnaryNot = left.type === types.AST_NODE_TYPES.UnaryExpression && left.operator === "!";
|
|
1604
1604
|
if (isLeftUnaryNot) {
|
|
1605
1605
|
return getReportDescriptor(right);
|
|
1606
1606
|
}
|
|
1607
1607
|
const initialScope = context.sourceCode.getScope(left);
|
|
1608
|
-
const isLeftNan =
|
|
1608
|
+
const isLeftNan = left.type === types.AST_NODE_TYPES.Identifier && left.name === "NaN" || eff.O.exists(VAR__namespace.getStaticValue(left, initialScope), (v) => v === "NaN");
|
|
1609
1609
|
if (isLeftNan) {
|
|
1610
1610
|
return eff.O.some({
|
|
1611
1611
|
messageId: "noLeakedConditionalRendering",
|
|
@@ -1634,7 +1634,7 @@ var no_leaked_conditional_rendering_default = createRule({
|
|
|
1634
1634
|
);
|
|
1635
1635
|
}).otherwise(eff.O.none);
|
|
1636
1636
|
}
|
|
1637
|
-
const visitorFunction = eff.F.flow(getReportDescriptor, eff.O.map(context.report)
|
|
1637
|
+
const visitorFunction = eff.F.flow(getReportDescriptor, eff.O.map(context.report));
|
|
1638
1638
|
return {
|
|
1639
1639
|
"JSXExpressionContainer > ConditionalExpression": visitorFunction,
|
|
1640
1640
|
"JSXExpressionContainer > LogicalExpression": visitorFunction
|
|
@@ -3026,7 +3026,7 @@ var prefer_destructuring_assignment_default = createRule({
|
|
|
3026
3026
|
continue;
|
|
3027
3027
|
}
|
|
3028
3028
|
const [props, ctx2] = component.params;
|
|
3029
|
-
const isMatch =
|
|
3029
|
+
const isMatch = (node2) => node2 != null && node2.type === types.AST_NODE_TYPES.Identifier && node2.name === memberExpression.object.name;
|
|
3030
3030
|
if (isMatch(props)) {
|
|
3031
3031
|
context.report({
|
|
3032
3032
|
messageId: "preferDestructuringAssignment",
|
package/dist/index.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import { getTypeImmutability, isUnknown, isImmutable, isReadonlyShallow, isReado
|
|
|
15
15
|
|
|
16
16
|
// package.json
|
|
17
17
|
var name = "eslint-plugin-react-x";
|
|
18
|
-
var version = "1.23.3-next.
|
|
18
|
+
var version = "1.23.3-next.7";
|
|
19
19
|
var createRule = createRuleForPlugin("x");
|
|
20
20
|
|
|
21
21
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -1573,12 +1573,12 @@ var no_leaked_conditional_rendering_default = createRule({
|
|
|
1573
1573
|
const services = ESLintUtils.getParserServices(context, false);
|
|
1574
1574
|
function getReportDescriptor(node) {
|
|
1575
1575
|
return match(node).when(AST11.isJSX, O.none).with({ type: AST_NODE_TYPES.LogicalExpression, operator: "&&" }, ({ left, right }) => {
|
|
1576
|
-
const isLeftUnaryNot =
|
|
1576
|
+
const isLeftUnaryNot = left.type === AST_NODE_TYPES.UnaryExpression && left.operator === "!";
|
|
1577
1577
|
if (isLeftUnaryNot) {
|
|
1578
1578
|
return getReportDescriptor(right);
|
|
1579
1579
|
}
|
|
1580
1580
|
const initialScope = context.sourceCode.getScope(left);
|
|
1581
|
-
const isLeftNan =
|
|
1581
|
+
const isLeftNan = left.type === AST_NODE_TYPES.Identifier && left.name === "NaN" || O.exists(VAR.getStaticValue(left, initialScope), (v) => v === "NaN");
|
|
1582
1582
|
if (isLeftNan) {
|
|
1583
1583
|
return O.some({
|
|
1584
1584
|
messageId: "noLeakedConditionalRendering",
|
|
@@ -1607,7 +1607,7 @@ var no_leaked_conditional_rendering_default = createRule({
|
|
|
1607
1607
|
);
|
|
1608
1608
|
}).otherwise(O.none);
|
|
1609
1609
|
}
|
|
1610
|
-
const visitorFunction = F.flow(getReportDescriptor, O.map(context.report)
|
|
1610
|
+
const visitorFunction = F.flow(getReportDescriptor, O.map(context.report));
|
|
1611
1611
|
return {
|
|
1612
1612
|
"JSXExpressionContainer > ConditionalExpression": visitorFunction,
|
|
1613
1613
|
"JSXExpressionContainer > LogicalExpression": visitorFunction
|
|
@@ -2999,7 +2999,7 @@ var prefer_destructuring_assignment_default = createRule({
|
|
|
2999
2999
|
continue;
|
|
3000
3000
|
}
|
|
3001
3001
|
const [props, ctx2] = component.params;
|
|
3002
|
-
const isMatch =
|
|
3002
|
+
const isMatch = (node2) => node2 != null && node2.type === AST_NODE_TYPES.Identifier && node2.name === memberExpression.object.name;
|
|
3003
3003
|
if (isMatch(props)) {
|
|
3004
3004
|
context.report({
|
|
3005
3005
|
messageId: "preferDestructuringAssignment",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.23.3-next.
|
|
3
|
+
"version": "1.23.3-next.7",
|
|
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",
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
"is-immutable-type": "^5.0.1",
|
|
49
49
|
"string-ts": "^2.2.0",
|
|
50
50
|
"ts-pattern": "^5.6.0",
|
|
51
|
-
"@eslint-react/ast": "1.23.3-next.
|
|
52
|
-
"@eslint-react/core": "1.23.3-next.
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/
|
|
51
|
+
"@eslint-react/ast": "1.23.3-next.7",
|
|
52
|
+
"@eslint-react/core": "1.23.3-next.7",
|
|
53
|
+
"@eslint-react/eff": "1.23.3-next.7",
|
|
54
|
+
"@eslint-react/jsx": "1.23.3-next.7",
|
|
55
|
+
"@eslint-react/types": "1.23.3-next.7",
|
|
56
|
+
"@eslint-react/shared": "1.23.3-next.7",
|
|
57
|
+
"@eslint-react/var": "1.23.3-next.7"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/react": "^19.0.4",
|