From 62dfee49305436173e6facd0db1237806eb72649 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 7 Oct 2020 02:57:32 -0700 Subject: [PATCH] eslint: Fix unicorn/prefer-node-append and unicorn/prefer-node-remove. https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prefer-node-append.md https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prefer-node-remove.md Signed-off-by: Anders Kaseorg --- static/js/scroll_bar.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/js/scroll_bar.js b/static/js/scroll_bar.js index cfd8b4a0aa..e856a64be4 100644 --- a/static/js/scroll_bar.js +++ b/static/js/scroll_bar.js @@ -13,7 +13,7 @@ function getScrollbarWidth() { outer.style.width = "100px"; outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps - document.body.appendChild(outer); + document.body.append(outer); const widthNoScroll = outer.offsetWidth; // force scrollbars @@ -22,12 +22,12 @@ function getScrollbarWidth() { // add innerdiv const inner = document.createElement("div"); inner.style.width = "100%"; - outer.appendChild(inner); + outer.append(inner); const widthWithScroll = inner.offsetWidth; // remove divs - outer.parentNode.removeChild(outer); + outer.remove(); return widthNoScroll - widthWithScroll; }