This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
New Linting Rule - No Accumulating Spread #4320
Closed
Vivalldi
started this conversation in
Suggestions
Replies: 1 comment
-
Initial implementation done in #4426 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Suggested Rule -
performance.noAccumulatingSpread
Disallow the use of spread (
...
) syntax on accumulators.Spread syntax allows an iterable to be expanded into its individual elements.
Spread syntax should be avoided on accumulators (like those in
.reduce
) because it causes a time complexity ofO(n^2)
.Examples
Invalid
Valid
Beta Was this translation helpful? Give feedback.
All reactions