lib: prefer logical assignment
Enforces https://eslint.org/docs/latest/rules/logical-assignment-operators
IMO logical assignment operators are more concise and readable than if/then and || statements. This way, we can do more in less code, while keeping the files readable.
Codecov Report
Attention: Patch coverage is 97.08738% with 3 lines in your changes missing coverage. Please review.
Project coverage is 88.42%. Comparing base (
bbdfeeb) to head (c9b98f4). Report is 365 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #55044 +/- ##
=======================================
Coverage 88.41% 88.42%
=======================================
Files 652 652
Lines 186612 186531 -81
Branches 36062 35981 -81
=======================================
- Hits 165001 164932 -69
+ Misses 14885 14873 -12
Partials 6726 6726
| Files with missing lines | Coverage Δ | |
|---|---|---|
| lib/_http_agent.js | 98.17% <100.00%> (-0.02%) |
:arrow_down: |
| lib/_http_client.js | 97.96% <100.00%> (ø) |
|
| lib/_tls_common.js | 97.43% <100.00%> (-0.02%) |
:arrow_down: |
| lib/_tls_wrap.js | 93.38% <100.00%> (ø) |
|
| lib/assert.js | 99.87% <100.00%> (ø) |
|
| lib/async_hooks.js | 99.65% <100.00%> (ø) |
|
| lib/child_process.js | 97.72% <100.00%> (-0.02%) |
:arrow_down: |
| lib/dgram.js | 97.31% <100.00%> (-0.01%) |
:arrow_down: |
| lib/events.js | 99.75% <100.00%> (-0.09%) |
:arrow_down: |
| lib/internal/assert.js | 100.00% <100.00%> (ø) |
|
| ... and 32 more |
CI: https://ci.nodejs.org/job/node-test-pull-request/62645/
WIP until I develop a lint rule.
@anonrig I enforced the logical-assignment-operators lint rule. Are you still blocking?
74 files is almost impossible to review for me.
@jasnell @trivikr @atlowChemi please rereview since the changes you approved are no longer the same.
@RedYetiDev what is the motivation for this change, please add it to your description for reviewers
@anonrig sorry for the little mistakes in this PR, i hope it's all good now. Thank you so much for your patience (everyone really)
Okay. This should be A-OK now, could everyone have another look?
Could someone restart the github CIs that failed to start?
@anonrig it's been a week, are you still blocking?
CI: https://ci.nodejs.org/job/node-test-pull-request/62878/
Can someone approve + CI so this can land after the most recent rebase?
CI: https://ci.nodejs.org/job/node-test-pull-request/62996/
Landed in 71785889c893a82f335e04a7e81c6ba08546a32e
This commit does not land cleanly on v22.x-staging and will need manual backport in case we want it in v22.x.