Skip to content

no-immediate-mutation: option to ignore Sets and Maps #2812

@BridgeAR

Description

@BridgeAR

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions