Skip to content

Commit fccd538

Browse files
committed
fix: inspectConstruction false negatives when using LogicalExpression and ConditionalExpression
1 parent 6c08ea2 commit fccd538

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.10.6-beta.0 (Mon Jan 8 2024)
2+
3+
### 🐞 Fixes
4+
5+
- Fix an issue where `react/no-constructed-context-value` and `react/no-unstable-default-props` would report false negatives when using LogicalExpression and ConditionalExpression.
6+
17
## v0.10.5 (Mon Jan 8 2024)
28

39
### ✨ New

packages/utilities/ast/src/construction/inspect-construction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export function inspectConstruction<T extends RuleContext>(
8181
.when(is(NodeType.LogicalExpression), (node) => {
8282
if (!("left" in node && "right" in node)) return None;
8383
const left = detect(node.left);
84-
if (left._tag === "None") return None;
84+
if (left._tag !== "None") return left;
8585

8686
return detect(node.right);
8787
})
@@ -90,7 +90,7 @@ export function inspectConstruction<T extends RuleContext>(
9090
return None;
9191
}
9292
const consequent = detect(node.consequent);
93-
if (consequent._tag === "None") return None;
93+
if (consequent._tag !== "None") return None;
9494

9595
return detect(node.alternate);
9696
})

0 commit comments

Comments
 (0)