Skip to content

[Fix]: detect missing keys in return statement with ternary operator #3928

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hyeonbinHur
Copy link

Fix #3925

@hyeonbinHur
Copy link
Author

Invalid Test Cases (4)

Case Scenario AST Patterns Covered
1: Basic Pattern return + ternary in map with ArrowFunction • ArrowFunction + BlockStatement + ReturnStatement
• ConditionalExpression with JSX elements
• Missing key detection in ternary branches
2: Function Expression return + ternary in map with regular function • FunctionExpression + BlockStatement + ReturnStatement
• ConditionalExpression handling across function types
• Same logic applies to function() syntax
3: Array.from Method return + ternary in Array.from iteration • Array.from + checkFunctionsBlockStatement call
• ConditionalExpression in different iteration contexts
• Multiple iteration method support
4: Fragment Context return + ternary within Fragment (Original Issue) • Fragment + map + return + ternary pattern
• Real-world user scenario reproduction
• Issue #3925 exact replication

Valid Test Cases (1)

Case Scenario Corresponding Invalid Case
1: Proper Keys return + ternary with correct key props Invalid 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: react/jsx-key rule is not applied when using return statement and ternary operator in iterator
1 participant