code cosmetics: fix some eslint complaints

Until https://github.com/eslint/eslint/issues/8594 is sorted out, we're switching to the old indent behavior (indent-legacy).
This commit is contained in:
tophf 2017-06-30 15:02:09 +03:00
parent 877d8b19e0
commit 5c1555c781
7 changed files with 20 additions and 22 deletions

View File

@ -93,7 +93,7 @@ rules:
id-blacklist: [0] id-blacklist: [0]
id-length: [0] id-length: [0]
id-match: [0] id-match: [0]
indent: [2, 2, {VariableDeclarator: 0, SwitchCase: 1}] indent-legacy: [2, 2, {VariableDeclarator: 0, SwitchCase: 1}]
jsx-quotes: [0] jsx-quotes: [0]
key-spacing: [0] key-spacing: [0]
keyword-spacing: [2] keyword-spacing: [2]

View File

@ -60,7 +60,6 @@ function applyOnMessage(request, sender, sendResponse) {
} }
switch (request.method) { switch (request.method) {
case 'styleDeleted': case 'styleDeleted':
removeStyle(request); removeStyle(request);
break; break;

View File

@ -292,7 +292,6 @@ function updateIcon(tab, styles) {
function onRuntimeMessage(request, sender, sendResponse) { function onRuntimeMessage(request, sender, sendResponse) {
switch (request.method) { switch (request.method) {
case 'getStyles': case 'getStyles':
getStyles(request).then(sendResponse); getStyles(request).then(sendResponse);
return KEEP_CHANNEL_OPEN; return KEEP_CHANNEL_OPEN;

View File

@ -378,8 +378,7 @@ Object.assign(document.body, {
if (event.target === this) { if (event.target === this) {
this.ondragend(); this.ondragend();
} }
} } catch (e) {
catch (e) {
this.ondragend(); this.ondragend();
} }
}, },

4
dom.js
View File

@ -58,7 +58,9 @@ function animateElement(
element.removeEventListener('animationend', _); element.removeEventListener('animationend', _);
element.classList.remove( element.classList.remove(
className, className,
...removeExtraClasses // In Firefox, `resolve()` might be called one frame later. This is helpful to clean-up on the same frame // In Firefox, `resolve()` might be called one frame later.
// This is helpful to clean-up on the same frame
...removeExtraClasses
); );
// TODO: investigate why animation restarts if the elements is removed in .then() // TODO: investigate why animation restarts if the elements is removed in .then()
if (remove) { if (remove) {

View File

@ -1,4 +1,4 @@
/* eslint no-tabs: 0, no-var: 0, indent: [2, tab, {VariableDeclarator: 0, SwitchCase: 1}], quotes: 0 */ /* eslint no-tabs: 0, no-var: 0, indent-legacy: [2, tab, {VariableDeclarator: 0, SwitchCase: 1}], quotes: 0 */
/* global CodeMirror */ /* global CodeMirror */
"use strict"; "use strict";

View File

@ -5,13 +5,13 @@ const FIREFOX = /Firefox/.test(navigator.userAgent);
const VIVALDI = /Vivaldi/.test(navigator.userAgent); const VIVALDI = /Vivaldi/.test(navigator.userAgent);
const OPERA = /OPR/.test(navigator.userAgent); const OPERA = /OPR/.test(navigator.userAgent);
document.addEventListener("stylishUpdate", onUpdateClicked); document.addEventListener('stylishUpdate', onUpdateClicked);
document.addEventListener("stylishUpdateChrome", onUpdateClicked); document.addEventListener('stylishUpdateChrome', onUpdateClicked);
document.addEventListener("stylishUpdateOpera", onUpdateClicked); document.addEventListener('stylishUpdateOpera', onUpdateClicked);
document.addEventListener("stylishInstall", onInstallClicked); document.addEventListener('stylishInstall', onInstallClicked);
document.addEventListener("stylishInstallChrome", onInstallClicked); document.addEventListener('stylishInstallChrome', onInstallClicked);
document.addEventListener("stylishInstallOpera", onInstallClicked); document.addEventListener('stylishInstallOpera', onInstallClicked);
chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => { chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
// orphaned content script check // orphaned content script check
@ -176,8 +176,7 @@ function checkUpdatability([installedStyle]) {
function sendEvent(type, detail = null) { function sendEvent(type, detail = null) {
if (FIREFOX) { if (FIREFOX) {
type = type.replace('Chrome', ''); type = type.replace('Chrome', '');
} } else if (OPERA || VIVALDI) {
else if (OPERA || VIVALDI) {
type = type.replace('Chrome', 'Opera'); type = type.replace('Chrome', 'Opera');
} }
detail = {detail}; detail = {detail};
@ -336,13 +335,13 @@ function orphanCheck() {
} }
// we're orphaned due to an extension update // we're orphaned due to an extension update
// we can detach event listeners // we can detach event listeners
document.removeEventListener("stylishUpdate", onUpdateClicked); document.removeEventListener('stylishUpdate', onUpdateClicked);
document.removeEventListener("stylishUpdateChrome", onUpdateClicked); document.removeEventListener('stylishUpdateChrome', onUpdateClicked);
document.removeEventListener("stylishUpdateOpera", onUpdateClicked); document.removeEventListener('stylishUpdateOpera', onUpdateClicked);
document.removeEventListener("stylishInstall", onInstallClicked); document.removeEventListener('stylishInstall', onInstallClicked);
document.removeEventListener("stylishInstallChrome", onInstallClicked); document.removeEventListener('stylishInstallChrome', onInstallClicked);
document.removeEventListener("stylishInstallOpera", onInstallClicked); document.removeEventListener('stylishInstallOpera', onInstallClicked);
// we can't detach chrome.runtime.onMessage because it's no longer connected internally // we can't detach chrome.runtime.onMessage because it's no longer connected internally
// we can destroy global functions in this context to free up memory // we can destroy global functions in this context to free up memory