-
-
Notifications
You must be signed in to change notification settings - Fork 417
Open
Labels
Description
Description
The new no-immediate-mutation rule is great for readability purposes and also good for performance for arrays and objects.
The performance for Sets and Maps is negatively impacted though if being used in case the entries that should be added are not already present in form of an array. The array needed to be allocated is CPU overhead that could be prevented.
It would be good to have an option to deactivate that rule part as such.
Examples
// ✅
const set = new Set()
set.add(1)
set.add(2)
set.add(3)Additional Info
No response
sindresorhus and fisker