From 1b307d3dc43cdbe75e8f3f5109313f3824859bb0 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 14 Feb 2022 20:54:28 -0800 Subject: [PATCH] [Tests] `prop-types`: add passing test Closes #2135 --- tests/lib/rules/prop-types.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/lib/rules/prop-types.js b/tests/lib/rules/prop-types.js index 547ad152f6..3b55e24882 100644 --- a/tests/lib/rules/prop-types.js +++ b/tests/lib/rules/prop-types.js @@ -3810,6 +3810,21 @@ ruleTester.run('prop-types', rule, { } } `, + }, + { + code: ` + const DisplayName = (props) => { + const getNameDiv = () => { + return
{props.name}
; + }; + + return getNameDiv(); + }; + + DisplayName.propTypes = { + name: PropTypes.string.isRequired, + }; + `, } )),