mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
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:
parent
d7122becaf
commit
8129815538
39 changed files with 200 additions and 202 deletions
|
@ -73,7 +73,7 @@ class TextLayerBuilder {
|
|||
if (!this.enhanceTextSelection) {
|
||||
const endOfContent = document.createElement("div");
|
||||
endOfContent.className = "endOfContent";
|
||||
this.textLayerDiv.appendChild(endOfContent);
|
||||
this.textLayerDiv.append(endOfContent);
|
||||
}
|
||||
|
||||
this.eventBus.dispatch("textlayerrendered", {
|
||||
|
@ -111,7 +111,7 @@ class TextLayerBuilder {
|
|||
});
|
||||
this.textLayerRenderTask.promise.then(
|
||||
() => {
|
||||
this.textLayerDiv.appendChild(textLayerFrag);
|
||||
this.textLayerDiv.append(textLayerFrag);
|
||||
this._finishRendering();
|
||||
this.highlighter?.enable();
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue