prefer-dom-node-append
UnreleasedConfiguration
rslint.config.ts
Rule Details
Prefer Element#append() over Node#appendChild().
An automatic fix is offered only for expression statements. Other uses are reported without a fix because appendChild returns the appended child, whereas append returns undefined. Computed names and optional calls are excluded. Arguments that are statically impossible DOM nodes, including null, void expressions, and equivalent wrapped or sequence expressions, are ignored; a locally shadowed identifier named undefined is not mistaken for the global value.
Examples of incorrect code:
Examples of correct code:
Options
This rule has no options. It is enabled at error severity in unicornPlugin.configs.recommended.