Enable the unicorn/prefer-dom-node-append ESLint plugin rule

This rule will help enforce slightly shorter code, especially since you can insert multiple elements at once, and according to MDN `Element.append()` is available in all browsers that we currently support.

Please find additional information here:
 - https://developer.mozilla.org/en-US/docs/Web/API/Element/append
 - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-append.md
This commit is contained in:
Jonas Jenwald 2022-06-12 12:20:25 +02:00
parent d7122becaf
commit 8129815538
39 changed files with 200 additions and 202 deletions

View file

@ -70,7 +70,7 @@ class XfaLayerBuilder {
// Create an xfa layer div and render the form
const div = document.createElement("div");
this.pageDiv.appendChild(div);
this.pageDiv.append(div);
parameters.div = div;
const result = XfaLayer.render(parameters);
@ -99,7 +99,7 @@ class XfaLayerBuilder {
}
// Create an xfa layer div and render the form
this.div = document.createElement("div");
this.pageDiv.appendChild(this.div);
this.pageDiv.append(this.div);
parameters.div = this.div;
return XfaLayer.render(parameters);
})