Skip to content

Commit

Permalink
fix: refine ReturnStatement check for jsx-key rule
Browse files Browse the repository at this point in the history
  • Loading branch information
yialo committed Sep 5, 2023
1 parent 228b644 commit 9acfec2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rules/jsx-key.js
Expand Up @@ -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') {
Expand Down

0 comments on commit 9acfec2

Please sign in to comment.