chore(eslint): update eslint-plugin-unicorn to 72 - #9503
Conversation
Overall package sizeSelf size: 7.46 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.2 | 124.41 kB | 440.65 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
🎉 All green!🧪 All tests passed 🔄 Datadog retried 1 test - 1 passed on retry 🎯 Code Coverage (details) 🔗 Commit SHA: f645b36 | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-07-27 12:23:27 Comparing candidate commit f645b36 in PR branch Found 1 performance improvements and 0 performance regressions! Performance is the same for 2320 metrics, 37 unstable metrics.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9503 +/- ##
==========================================
+ Coverage 98.43% 98.44% +0.01%
==========================================
Files 947 947
Lines 128070 128100 +30
Branches 10931 10940 +9
==========================================
+ Hits 126061 126112 +51
+ Misses 2009 1988 -21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ca96e46 to
b23ecda
Compare
There was a problem hiding this comment.
More details
The behavioral rewrites preserve output across the exercised edge cases, including built-in resolution, disabled instrumentation aliases, shell-variable scrubbing, asynchronous metric export, and token fallbacks. No diff-caused runtime regression was reproduced.
📊 Validated against 9 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit b23ecda · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
Post-Node 18 API recommendations stay disabled for backports. Promise and short-circuit rewrites remain deferred because they broaden existing behavior. Folding SHA filtering into the existing loop measured 13.9 µs to 11.9 µs for 500 entries on Node 24.18.0 (7 trials, drop best and worst).
Keep negated array predicates disabled because the inverted forms obscure existing preconditions. Preserve explicit string coercion only where values are not guaranteed to be strings.
Error metadata assignments remain only where an integration must preserve an upstream stack or error type.
Built-in modules produce a null package name. Passing it to require.resolve caused repeated build failures across esbuild consumers.
All six findings intentionally preserve upstream error names or stacks, so enabling the rule only adds suppressions.
An ignored finally promise can reject with either the original test failure or a finalizer error. Running the finalizer as both promise handlers preserves the original returned promise while containing finalizer failures.
Direct variable capture measured 91.5 to 71.5 ns for one variable and 2006 to 1544 ns for 20. Swapping drained arrays measured 31.8 to 12.5 ns at one item and 599 to 276 ns at 1000 items on Node 24.18.0 (7 trials, drop best and worst).
The only finding is a hot ID parser guard where the opposite comparison does not preserve NaN handling.
Spreading undefined or null contributes no properties, so the nullish guards the jest plugin wrapped its optional tag spreads in were already dead.
The rule rewrites a ternary of two require calls into a require of a ternary, which our restricted-syntax rule rejects as a dynamic require, so the findings worth taking are applied by hand instead.
Passing a limit to split forces V8 off its constant-limit fast path, so the sites that read a single segment use getSegment instead. The rest genuinely read every segment, where getSegment rescans the string once per call and loses.
Both HTTP clients derived the span resource path with split(/[?#]/)[0], which allocates an array and a substring for every outgoing request even when the path carries neither delimiter. Scanning for both delimiters and slicing once takes 14.7ns instead of 41.4ns per call over a representative mix of five paths.
The rule reports nothing on the current tree. The count the entry carried, and the false-positive risk it warned about, predate the v72 rewrite of the rule.
Exact violation counts drift with every unrelated change, so most of them were already wrong: catch-error-name reported 242 rather than "many", and no-invalid-argument-count reported none rather than 98.
… 0x80 encodeVarintInto exited its 7-bit loop while the remaining value was still 0x80 and then masked the continuation bit off the final byte, dropping that bit. Every value whose zig-zag form shifts down to exactly 0x80 encoded as a truncated number: 64, then a band of 2 ** (exponent - 7) values above every seventh power of two. Pathway contexts carry millisecond epoch timestamps, which enter the next affected band on 2039-09-07 and leave it on 2040-03-24.
9787950 to
f645b36
Compare
|
The rules make sense. I didn't review every line of code in here. It looks like there's a few small changes unrelated to the rules but those changes seem fine as well. |
Activate Node.js 18 compatible rules that remove redundant syntax and catch correctness issues. 1. Skip esbuild resolution for built-in modules without package paths. 2. Contain detached Cucumber finalizer rejections without changing the returned test promise. 3. Preserve datastream varint continuation bits at 0x80 boundaries. 4. Avoid buffering Electron traces when the trace channel has no subscribers. 5. Replace regex-based HTTP path splitting with a shared delimiter scan, reducing representative cost from 41.4 ns to 14.7 ns per call.
Activate Node.js 18 compatible rules that remove redundant syntax and catch correctness issues. 1. Skip esbuild resolution for built-in modules without package paths. 2. Contain detached Cucumber finalizer rejections without changing the returned test promise. 3. Preserve datastream varint continuation bits at 0x80 boundaries. 4. Avoid buffering Electron traces when the trace channel has no subscribers. 5. Replace regex-based HTTP path splitting with a shared delimiter scan, reducing representative cost from 41.4 ns to 14.7 ns per call.
Summary
Updates eslint-plugin-unicorn from 68 to 72 and enables correctness and readability rules that fit the existing code without changing supported runtime behavior.
Why
Rules requiring post-Node 18 APIs stay disabled for backports. Promise, short-circuit, dynamic replacement, and other semantic rewrites remain deferred where the suggested form is less clear or changes behavior.
Folding empty SHA filtering into the existing release loop measured 13.9 µs to 11.9 µs for 500 entries on Node 24.18.0 (7 trials, drop best and worst).