New eslint config with no-multi-assign

This commit is contained in:
Andreas Hocevar
2019-11-02 15:20:21 +01:00
parent 06ae419db6
commit ac50cc3460
35 changed files with 162 additions and 85 deletions

View File

@@ -311,13 +311,15 @@ export const measureTextHeight = (function() {
if (!div) {
div = document.createElement('div');
div.innerHTML = 'M';
div.style.margin = div.style.padding = '0 !important';
div.style.margin = '0 !important';
div.style.padding = '0 !important';
div.style.position = 'absolute !important';
div.style.left = '-99999px !important';
}
div.style.font = font;
document.body.appendChild(div);
height = heights[font] = div.offsetHeight;
height = div.offsetHeight;
heights[font] = height;
document.body.removeChild(div);
}
return height;
@@ -351,7 +353,8 @@ export function measureAndCacheTextWidth(font, text, cache) {
if (text in cache) {
return cache[text];
}
const width = cache[text] = measureTextWidth(font, text);
const width = measureTextWidth(font, text);
cache[text] = width;
return width;
}