diff --git a/tests/lib/rules/prop-types.js b/tests/lib/rules/prop-types.js index df762d74ef..97206b7d44 100644 --- a/tests/lib/rules/prop-types.js +++ b/tests/lib/rules/prop-types.js @@ -3361,6 +3361,20 @@ ruleTester.run('prop-types', rule, { `, features: ['ts', 'no-babel'], }, + { + code: ` + import React from "react"; + + const returnTypeProp = (someProp: any) => ({ someProp }); + + const SomeComponent: React.FunctionComponent< + ReturnType + > = ({ someProp }) => { + return
{someProp}
; + }; + `, + features: ['ts', 'no-babel'], + }, { code: ` export const EuiSuperSelectControl: ( @@ -7840,6 +7854,26 @@ ruleTester.run('prop-types', rule, { ], features: ['ts', 'no-babel'], }, + { + code: ` + import React from "react"; + + const returnTypeProp = (someProp: any) => ({ someProp }); + + const SomeComponent: React.FunctionComponent< + ReturnType + > = ({ someIncorrectProp }) => { + return
{someProp}
; + }; + `, + errors: [ + { + messageId: 'missingPropType', + data: { name: 'someIncorrectProp' }, + }, + ], + features: ['ts', 'no-babel'], + }, { code: ` import React from 'react';