silence eslint; switch shirt-circuiting to single-line if/else

This commit is contained in:
tophf 2017-12-18 09:57:00 +03:00
parent 31fd551264
commit 6607455e8f
5 changed files with 10 additions and 9 deletions

View File

@ -1,3 +1,4 @@
/* global cloneInto */
'use strict';
(() => {
@ -93,7 +94,7 @@
if (typeof cloneInto !== 'undefined') {
// Firefox requires explicit cloning, however USO can't process our messages anyway
// because USO tries to use a global "event" variable deprecated in Firefox
detail = cloneInto(detail, document); // eslint-disable-line no-undef
detail = cloneInto(detail, document);
}
onDOMready().then(() => {
document.dispatchEvent(new CustomEvent(type, detail));

View File

@ -159,7 +159,7 @@ function sendMessage(msg, callback) {
fn(...args, r => {
const err = r && r.__ERROR__;
(err ? reject : resolve)(err || r);
chrome.runtime.lastError; // eslint-disable-line no-unused-expressions
ignoreChromeError();
});
});
}
@ -268,7 +268,8 @@ function stringAsRegExp(s, flags) {
function ignoreChromeError() {
chrome.runtime.lastError; // eslint-disable-line no-unused-expressions
// eslint-disable-next-line no-unused-expressions
chrome.runtime.lastError;
}

View File

@ -51,9 +51,7 @@ var usercss = (() => {
return loadScript('/vendor/stylus-lang/stylus.min.js').then(() => (
new Promise((resolve, reject) => {
const varDef = Object.keys(vars).map(key => `${key} = ${vars[key].value};\n`).join('');
// eslint-disable-next-line no-undef
stylus(varDef + source).render((err, output) => {
window.stylus(varDef + source).render((err, output) => {
if (err) {
reject(err);
} else {

View File

@ -392,7 +392,7 @@ Object.assign(handleEvent, {
},
config(event, {styleMeta}) {
event.preventDefault()
event.preventDefault();
configDialog(styleMeta);
},
});

View File

@ -183,7 +183,7 @@
}
lineCacheAlive = true;
!elements && (elements = text.getElementsByClassName(OWN_TOKEN_CLASS));
if (!elements) elements = text.getElementsByClassName(OWN_TOKEN_CLASS);
do {
el = elements[elementIndex];
elementIndex += el && el.classList.contains(DISABLED_NEXT_TOKEN_CLASS) ? 2 : 1;
@ -202,7 +202,7 @@
bg.title = options.tooltip;
}
bg.style.setProperty('background-color', data.color, 'important');
!bg.parentNode && el.appendChild(bg);
if (!bg.parentNode) el.appendChild(bg);
}
if (lineCacheAlive) {
@ -450,6 +450,7 @@
}
openPopup(color) {
// eslint-disable-next-line prefer-const
let {line, ch} = this.cm.getCursor();
const lineText = this.cm.getLine(line);
const lineTextLC = lineText.toLowerCase();