refactor: enable prefer-object-spread rule for all files#7488
Conversation
Move prefer-object-spread ESLint rule from restricted section
to main rules to apply it across all files. Update codebase to
use object spread syntax ({ ...obj }) instead of Object.assign()
calls.
Overall package sizeSelf size: 4.58 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.6 | 81.92 kB | 813.08 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7488 +/- ##
=======================================
Coverage 80.31% 80.31%
=======================================
Files 731 731
Lines 31131 31131
=======================================
+ Hits 25002 25003 +1
+ Misses 6129 6128 -1 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-02-11 13:28:24 Comparing candidate commit 2c8c339 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 229 metrics, 31 unstable metrics. |
BridgeAR
left a comment
There was a problem hiding this comment.
LGTM
We could consider moving a lot more rules over to apply to all code. I guess a lot of them could be auto fixed or do not cause a lot of issues.
Move prefer-object-spread ESLint rule from restricted section
to main rules to apply it across all files. Update codebase to
use object spread syntax ({ ...obj }) instead of Object.assign()
calls.
Move prefer-object-spread ESLint rule from restricted section
to main rules to apply it across all files. Update codebase to
use object spread syntax ({ ...obj }) instead of Object.assign()
calls.
Move prefer-object-spread ESLint rule from restricted section
to main rules to apply it across all files. Update codebase to
use object spread syntax ({ ...obj }) instead of Object.assign()
calls.

What does this PR do?
Enables the
prefer-object-spreadESLint rule for all files and updates the codebase to use object spread syntax ({ ...obj }) instead ofObject.assign()calls.The rule was previously enabled only for certain file patterns. This change moves it to the main rules section in
eslint.config.mjsto apply consistently across the entire codebase, and updates all existing violations.Motivation
Using object spread syntax is more modern, readable, and aligns with current JavaScript best practices. Standardizing on this pattern across the codebase improves consistency and code quality.