Skip to content

Comments

fix(prefer-optional-chaining): various false positives discovered#732

Merged
camc314 merged 4 commits intooxc-project:mainfrom
RTVision:fix/prefer-optional-chaining-false-positives
Feb 24, 2026
Merged

fix(prefer-optional-chaining): various false positives discovered#732
camc314 merged 4 commits intooxc-project:mainfrom
RTVision:fix/prefer-optional-chaining-false-positives

Conversation

@kalvenschraut
Copy link
Contributor

Trying get this rule going in my companies internal code base now that I have oxlint setup and found what I would consider false positives. Used AI to help come up with fixes and looked over the changes/verified they fix everything in my codebase.

@connorshea
Copy link
Member

Have you compared the result to the original typescript-eslint rule? We generally defer to the original rule in terms of what behavior is considered correct.

@kalvenschraut
Copy link
Contributor Author

kalvenschraut commented Feb 22, 2026

I had the rule enabled prior when using eslint and it didnt report the error. I did verify this by checking out a branch that still has this rule on for eslint. The oxlint rule actually reported a couple other cases that I considered correct and modified the code to resolve 🤷. This rule was definitely a big pain to try implement correctly when I first worked on it.

@kalvenschraut
Copy link
Contributor Author

kalvenschraut commented Feb 22, 2026

image Did double check that the tests fail on main for all the ones I added

Copy link
Member

@connorshea connorshea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests make sense to me and all pass in the original rule. I can't speak to the logic changes themselves as I'm not especially familiar with Go, so I will defer to cam on that part.

@camc314 camc314 self-assigned this Feb 24, 2026
@camc314 camc314 enabled auto-merge (squash) February 24, 2026 16:57
@camc314 camc314 merged commit 5212b6c into oxc-project:main Feb 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants