From 9acfec211cdf37e1eeaac01b9b49e0afd9b10779 Mon Sep 17 00:00:00 2001 From: Aleksei Arro Date: Tue, 5 Sep 2023 14:05:04 +0400 Subject: [PATCH] fix: refine ReturnStatement check for jsx-key rule --- lib/rules/jsx-key.js | 2 ++ 1 file changed, 2 insertions(+) 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') {