diff --git a/lib/rules/jsx-key.js b/lib/rules/jsx-key.js index 263ed8243c..c13a00cf83 100644 --- a/lib/rules/jsx-key.js +++ b/lib/rules/jsx-key.js @@ -96,6 +96,8 @@ module.exports = { if (node.alternate) { getReturnStatements(node.alternate, returnStatements); } + } else if (node.type === 'ReturnStatement') { + returnStatements.push(node); } else if (Array.isArray(node.body)) { node.body.forEach((item) => { if (item.type === 'IfStatement') {