-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin): [prefer-optional-chain] use type checking for strict falsiness #6240
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
feat(eslint-plugin): [prefer-optional-chain] use type checking for strict falsiness #6240
Conversation
Thanks for the PR, @JoshuaKGoldberg! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## v6 #6240 +/- ##
==========================================
- Coverage 85.23% 85.21% -0.03%
==========================================
Files 372 373 +1
Lines 12729 12738 +9
Branches 3783 3785 +2
==========================================
+ Hits 10850 10855 +5
- Misses 1499 1502 +3
- Partials 380 381 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Lots of merge conflicts here, will need to fix up... eventually. |
154811b
to
1b22295
Compare
1f5c44e
to
8d847e3
Compare
Closing in favor of #6397. Woop! |
BREAKING CHANGE:
Adds type checking to
prefer-optional-chain
PR Checklist
Overview
Uses the type checker to skip reporting a complaint when the original expression includes a falsy value that isn't
undefined
.Also adds a
looseFalsiness
flag to allow the old, faster behavior.Streamlines the test file because autogenerated tests are giving me headaches.