-
-
Notifications
You must be signed in to change notification settings - Fork 791
fix(noNestedTernary): detect nested ternaries wrapped in parentheses #8086
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
fix(noNestedTernary): detect nested ternaries wrapped in parentheses #8086
Conversation
🦋 Changeset detectedLatest commit: 2fdaf13 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
CodSpeed Performance ReportMerging #8086 will not alter performanceComparing Summary
Footnotes
|
WalkthroughThis change updates the Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
dyc3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love to see an easy fix
Co-authored-by: Carson McManus <[email protected]>
…iomejs#8086) Co-authored-by: Carson McManus <[email protected]>
AI Assistance Notice
This PR was written primarily with Claude Code. See Contribution Guidelines - AI Assistance.
Summary
Fixes #8045
The
noNestedTernaryrule now correctly detects nested ternary expressions even when they are wrapped in parentheses.Previously, the rule would not flag nested ternaries like
foo ? (bar ? 1 : 2) : 3because the parentheses prevented detection.Test Plan
I added valid and invalid tests with ternary operators in parenthesis.
Docs
Changeset included
Implementation notes
This is a two line change to production code, using
consequent.omit_parentheses()in place ofconsequent.