Rule: no-dynamic-delete
Bans usage of the delete operator with computed key expressions.
Rationale
Deleting dynamically computed keys is dangerous and not well optimized.
Also consider using a Map
or Set
if you’re storing collections of objects.
Using Object
s can cause occasional edge case bugs, such as if a key is named “hasOwnProperty”.
Config
Not configurable.
Config examples
"no-dynamic-delete": true
Schema
null