💅 Object.assign on Accumulators Shouldn't Be Allowed #5277
Labels
A-Linter
Area: linter
good first issue
Good for newcomers
L-JavaScript
Language: JavaScript and super languages
S-Bug-confirmed
Status: report has been confirmed as a valid bug
Environment information
Rule name
no-accumulating-spread
Playground link
https://biomejs.dev/playground/?code=YwBvAG4AcwB0ACAAYQByAHIAYQB5AE8AZgBPAGIAagBzACAAPQAgAFsAewAKACAAIABoAGUAbABsAG8AOgAgACcAdwBvAHIAbABkACEAJwAKAH0AXQAKAAoAYQByAHIAYQB5AE8AZgBPAGIAagBzAC4AcgBlAGQAdQBjAGUAKAAoAGEAYwBjAHUAbQAsACAAbwBiAGoAKQAgAD0APgAgAE8AYgBqAGUAYwB0AC4AYQBzAHMAaQBnAG4AKABhAGMAYwB1AG0ALAAgAG8AYgBqACkALAAgAHsAfQApAA%3D%3D
Expected result
The No Accumulating Spread rule prevents the
O(n^2)
problem by not allowing the use of object spreader syntax on accumulators. However, object spreader syntax is just syntactical sugar forObject.assign
. And no error is shown for utilizingObject.assign
on an accumulator, even though it faces the sameO(n^2)
problem.Code of Conduct
The text was updated successfully, but these errors were encountered: