1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +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:
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

@ -155,7 +155,7 @@ function renderBooleanPref(shortDescription, description, prefName) {
storageArea.set(pref);
};
wrapper.querySelector("span").textContent = shortDescription;
document.getElementById("settings-boxes").appendChild(wrapper);
document.getElementById("settings-boxes").append(wrapper);
function renderPreference(value) {
checkbox.checked = value;
@ -172,7 +172,7 @@ function renderEnumPref(shortDescription, prefName) {
storageArea.set(pref);
};
wrapper.querySelector("span").textContent = shortDescription;
document.getElementById("settings-boxes").appendChild(wrapper);
document.getElementById("settings-boxes").append(wrapper);
function renderPreference(value) {
select.value = value;
@ -189,7 +189,7 @@ function renderDefaultZoomValue(shortDescription) {
});
};
wrapper.querySelector("span").textContent = shortDescription;
document.getElementById("settings-boxes").appendChild(wrapper);
document.getElementById("settings-boxes").append(wrapper);
function renderPreference(value) {
value = value || "auto";