Skip to content

Commit 579ea7e

Browse files
CopilotRel1cx
authored andcommitted
[WIP] WIP address feedback on renaming component detection hints (#1485)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 17af0e8 commit 579ea7e

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

packages/core/src/component/component-detection-hint.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ export const ComponentDetectionHint = {
2121
* Default component detection hint
2222
*/
2323
export const DEFAULT_COMPONENT_DETECTION_HINT = 0n
24-
| JsxDetectionHint.DoNotIncludeJsxWithNumberValue
2524
| ComponentDetectionHint.DoNotIncludeJsxWithBigIntValue
2625
| ComponentDetectionHint.DoNotIncludeJsxWithBooleanValue
26+
| ComponentDetectionHint.DoNotIncludeJsxWithNumberValue
2727
| ComponentDetectionHint.DoNotIncludeJsxWithStringValue
2828
| ComponentDetectionHint.DoNotIncludeJsxWithUndefinedValue
29-
| ComponentDetectionHint.RequireAllArrayElementsToBeJsx
30-
| ComponentDetectionHint.RequireBothSidesOfLogicalExpressionToBeJsx
31-
| ComponentDetectionHint.RequireBothBranchesOfConditionalExpressionToBeJsx
29+
| ComponentDetectionHint.DoNotIncludeFunctionDefinedAsArrayMapCallback
3230
| ComponentDetectionHint.DoNotIncludeFunctionDefinedInArrayExpression
3331
| ComponentDetectionHint.DoNotIncludeFunctionDefinedInArrayPattern
34-
| ComponentDetectionHint.DoNotIncludeFunctionDefinedAsArrayMapCallback;
32+
| ComponentDetectionHint.RequireAllArrayElementsToBeJsx
33+
| ComponentDetectionHint.RequireBothBranchesOfConditionalExpressionToBeJsx
34+
| ComponentDetectionHint.RequireBothSidesOfLogicalExpressionToBeJsx;

packages/core/src/jsx/jsx-detection.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ export function isJsxLike(
109109
if (node.elements.length === 0) {
110110
return !(hint & JsxDetectionHint.DoNotIncludeJsxWithEmptyArrayValue);
111111
}
112-
// StrictArray requires all elements to be JSX
112+
// Requires all elements to be JSX
113113
if (hint & JsxDetectionHint.RequireAllArrayElementsToBeJsx) {
114114
return node.elements.every((n) => isJsxLike(code, n, hint));
115115
}
116116
// Default: array is JSX-like if any element is JSX-like
117117
return node.elements.some((n) => isJsxLike(code, n, hint));
118118
}
119119
case AST.LogicalExpression: {
120-
// StrictLogical requires both sides to be JSX
120+
// Requires both sides to be JSX
121121
if (hint & JsxDetectionHint.RequireBothSidesOfLogicalExpressionToBeJsx) {
122122
return isJsxLike(code, node.left, hint) && isJsxLike(code, node.right, hint);
123123
}
@@ -144,7 +144,7 @@ export function isJsxLike(
144144
return isJsxLike(code, node.alternate, hint);
145145
}
146146

147-
// StrictConditional requires both branches to contain JSX
147+
// Requires both branches to contain JSX
148148
if (hint & JsxDetectionHint.RequireBothBranchesOfConditionalExpressionToBeJsx) {
149149
return leftHasJSX(node) && rightHasJSX(node);
150150
}

0 commit comments

Comments
 (0)