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 |
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.