@@ -3361,6 +3361,20 @@ ruleTester.run('prop-types', rule, {
3361
3361
` ,
3362
3362
features : [ 'ts' , 'no-babel' ] ,
3363
3363
} ,
3364
+ {
3365
+ code : `
3366
+ import React from "react";
3367
+
3368
+ const returnTypeProp = (someProp: any) => ({ someProp });
3369
+
3370
+ const SomeComponent: React.FunctionComponent<
3371
+ ReturnType<typeof returnTypeProp>
3372
+ > = ({ someProp }) => {
3373
+ return <div>{someProp}</div>;
3374
+ };
3375
+ ` ,
3376
+ features : [ 'ts' , 'no-babel' ] ,
3377
+ } ,
3364
3378
{
3365
3379
code : `
3366
3380
export const EuiSuperSelectControl: <T extends string>(
@@ -7840,6 +7854,26 @@ ruleTester.run('prop-types', rule, {
7840
7854
] ,
7841
7855
features : [ 'ts' , 'no-babel' ] ,
7842
7856
} ,
7857
+ {
7858
+ code : `
7859
+ import React from "react";
7860
+
7861
+ const returnTypeProp = (someProp: any) => ({ someProp });
7862
+
7863
+ const SomeComponent: React.FunctionComponent<
7864
+ ReturnType<typeof returnTypeProp>
7865
+ > = ({ someIncorrectProp }) => {
7866
+ return <div>{someProp}</div>;
7867
+ };
7868
+ ` ,
7869
+ errors : [
7870
+ {
7871
+ messageId : 'missingPropType' ,
7872
+ data : { name : 'someIncorrectProp' } ,
7873
+ } ,
7874
+ ] ,
7875
+ features : [ 'ts' , 'no-babel' ] ,
7876
+ } ,
7843
7877
{
7844
7878
code : `
7845
7879
import React from 'react';
0 commit comments