Fix eslint issues

This commit is contained in:
Rob Garrison 2017-07-12 15:44:59 -05:00
parent 508f71f26b
commit 0037c699d9
3 changed files with 526 additions and 486 deletions

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,7 @@ for (const type of [NodeList, NamedNodeMap, HTMLCollection, HTMLAllCollection])
}
// add favicon in Firefox
// eslint-disable-next-line no-unused-expressions
navigator.userAgent.includes('Firefox') && setTimeout(() => {
const iconset = ['', 'light/'][prefs.get('iconset')] || '';
for (const size of [38, 32, 19, 16]) {

View File

@ -128,8 +128,11 @@ function showStyles(styles = []) {
function renderStyles() {
const t0 = performance.now();
let rendered = 0;
while (index < sorted.length
&& (shouldRenderAll || ++rendered < 10 || performance.now() - t0 < 10)) {
while (
index < sorted.length &&
// eslint-disable-next-line no-unmodified-loop-condition
(shouldRenderAll || ++rendered < 10 || performance.now() - t0 < 10)
) {
renderBin.appendChild(createStyleElement(sorted[index++]));
}
filterAndAppend({container: renderBin});
@ -976,9 +979,14 @@ function objectDiff(first, second, path = '') {
continue;
}
if (a && typeof a.filter == 'function' && b && typeof b.filter == 'function') {
if (a.length != b.length
|| a.some((el, i) => !el || typeof el != 'object' ? el != b[i]
: objectDiff(el, b[i], path + key + '[' + i + '].').length)
if (
a.length != b.length ||
a.some((el, i) => {
const result = !el || typeof el != 'object'
? el != b[i]
: objectDiff(el, b[i], path + key + '[' + i + '].').length;
return result;
})
) {
diff.push({path, key, values: [a, b], type: 'changed'});
}