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 <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-10-07 02:57:32 -07:00 committed by Tim Abbott
parent 8098acb63c
commit 62dfee4930
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}