Skip to content
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

💅 Object.assign on Accumulators Shouldn't Be Allowed #5277

Open
1 task done
mssngr opened this issue Mar 4, 2025 · 0 comments
Open
1 task done

💅 Object.assign on Accumulators Shouldn't Be Allowed #5277

mssngr opened this issue Mar 4, 2025 · 0 comments
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

Comments

@mssngr
Copy link

mssngr commented Mar 4, 2025

Environment information

I am using Biome strictly in the IDE, so this n/a for me.

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 for Object.assign. And no error is shown for utilizing Object.assign on an accumulator, even though it faces the same O(n^2) problem.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@mssngr mssngr added the S-Needs triage Status: this issue needs to be triaged label Mar 4, 2025
@dyc3 dyc3 added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug labels Mar 4, 2025
@github-actions github-actions bot removed the S-Needs triage Status: this issue needs to be triaged label Mar 4, 2025
@dyc3 dyc3 added good first issue Good for newcomers S-Needs triage Status: this issue needs to be triaged labels Mar 4, 2025
@github-actions github-actions bot removed the S-Needs triage Status: this issue needs to be triaged label Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants