Skip to content

Commit 99bd721

Browse files
committed
[Fix] prop-types: positives since upgrading typescript-eslint to v8
1 parent a2306e7 commit 99bd721

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: lib/util/propTypes.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -1044,8 +1044,10 @@ module.exports = function propTypesInstructions(context, components, utils) {
10441044
if (
10451045
node.parent
10461046
&& node.parent.callee
1047-
&& node.parent.typeParameters
1048-
&& node.parent.typeParameters.params
1047+
&& (
1048+
(node.parent.typeParameters && node.parent.typeParameters.params)
1049+
|| (node.parent.typeArguments && node.parent.typeArguments.params)
1050+
)
10491051
&& (
10501052
node.parent.callee.name === 'forwardRef' || (
10511053
node.parent.callee.object
@@ -1055,7 +1057,7 @@ module.exports = function propTypesInstructions(context, components, utils) {
10551057
)
10561058
)
10571059
) {
1058-
const propTypesParams = node.parent.typeParameters;
1060+
const propTypesParams = node.parent.typeParameters || node.parent.typeArguments;
10591061
const declaredPropTypes = {};
10601062
const obj = new DeclarePropTypesForTSTypeAnnotation(propTypesParams.params[1], declaredPropTypes, rootNode);
10611063
components.set(node, {

0 commit comments

Comments
 (0)