Skip to content

Commit d0645d5

Browse files
committed
fixup! Integrate eslint react-fc-component-definition
"Since we are going to return strings like \"React.ReactElement\", should we be more explicit about putting full type names in the `JSX_RETURN_TYPES` array? I see that we use `.endsWith` to do the check, so we could alternatively just return `typeName.right.name` and skip the recursion, since we don't actually care what's on the left."
1 parent fec5ad1 commit d0645d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/eslint-plugin-edge/react-fc-component-definition.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ function getTypeName(typeName) {
5252
return typeName.name
5353
}
5454
// Handle qualified names like `React.ReactElement` or `React.JSX.Element`
55+
// We only need the rightmost name since we use `.endsWith()` checks
5556
if (typeName.type === 'TSQualifiedName') {
56-
return getTypeName(typeName.left) + '.' + typeName.right.name
57+
return typeName.right.name
5758
}
5859
return ''
5960
}

0 commit comments

Comments
 (0)