-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin): [prefer-nullish-coalescing]: add support for assignment expressions #5234
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-nullish-coalescing]: add support for assignment expressions #5234
Conversation
…gnment expressions
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. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day. |
✅ 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 #5234 +/- ##
==========================================
+ Coverage 91.33% 91.44% +0.11%
==========================================
Files 361 355 -6
Lines 12044 12060 +16
Branches 3506 3531 +25
==========================================
+ Hits 11000 11028 +28
+ Misses 748 733 -15
- Partials 296 299 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Thanks for working on this! I'm currently running this on the TS codebase (as in some benchmarks, even our downleveled code for (I have to fork in order to skip the rule when the left side is potentially a string/number/boolean; applying the fixes from this rule without review breaks a few things as the behavior is not equivalent.) |
note that technically This is a very slight difference that makes them marginally faster because you only assign if it's required. |
…ignment expressions (#5234) BREAKING CHANGE: Adds an additional class of checks to the rule
PR Checklist
Overview
Adds
||=
to??=
support to the rule by reusing much of the existing rule's logic.Note that this is a breaking change, as it targets a significant new area of syntax. We'll probably have to wait until 6.X to merge. 😕