Skip to content

Commit 7feb778

Browse files
committed
Remove incorrect type annotation
1 parent 291d1bc commit 7feb778

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/util/propTypes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ module.exports = function propTypesInstructions(context, components, utils) {
588588
* `typeParameters` to `typeArguments`
589589
* https://typescript-eslint.io/troubleshooting/faqs/general/#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings
590590
* @param {ASTNode} node The AST node being checked.
591-
* @returns {string | undefined}
591+
* @returns {any | undefined} Type parameters or arguments
592592
*/
593593
function getNodeTypeArguments(node) {
594594
if (!node) return;
@@ -652,7 +652,7 @@ module.exports = function propTypesInstructions(context, components, utils) {
652652
const leftMostName = getLeftMostTypeName(node.typeName);
653653
const shouldTraverseTypeParams = genericReactTypesImport.has(leftMostName);
654654
const nodeTypeArgs = getNodeTypeArguments(node);
655-
if (shouldTraverseTypeParams && nodeTypeArgs && nodeTypeArgs.length !== 0) {
655+
if (shouldTraverseTypeParams && nodeTypeArgs && nodeTypeArgs.params.length !== 0) {
656656
// All react Generic types are derived from:
657657
// type PropsWithChildren<P> = P & { children?: ReactNode | undefined }
658658
// So we should construct an optional children prop

0 commit comments

Comments
 (0)