fix(linter/array-callback-return): fix handling of default case in switch statements for array-callback-return rule#13081
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
CodSpeed Instrumentation Performance ReportMerging #13081 will not alter performanceComparing Summary
|
…itch statements for array-callback-return rule - fixes(oxc-project#13075) - Consider cases following the default case in switch statements
8a0aac6 to
f3e88f5
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in the array-callback-return linter rule where switch statements with default cases followed by other cases were not handled correctly. The fix ensures that when a default case falls through to subsequent cases, those cases are properly considered for return status analysis.
- Updated switch statement logic to track when default cases fall through to subsequent cases
- Added test case to verify proper handling of default case followed by labeled case
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| return_checker.rs | Fixed switch statement logic to handle default case fallthrough scenarios |
| mod.rs | Added test case for default case followed by labeled case |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
fix handling of default case in switch statements for array-callback-return rule