✅ This rule is part of the recommended config.
🔧💡 This rule is auto-fixable and provides suggestions.
Enforces the use of, for example, child.remove();
over child.parentNode.removeChild(child);
. The DOM function Node#remove()
is preferred over the indirect removal of an object with Node#removeChild()
.
parentNode.removeChild(foo);
parentNode.removeChild(this);
foo.remove();
this.remove();