Fix linting issues

This commit is contained in:
Rob Garrison 2018-12-11 06:40:54 -06:00
parent b57d30a70b
commit 3edea88b13
6 changed files with 7 additions and 8 deletions

View File

@ -341,7 +341,7 @@
// run in page context
document.documentElement.appendChild(document.createElement('script')).text = '(' + (
EXTENSION_ORIGIN => {
() => {
document.currentScript.remove();
// spoof Stylish extension presence in Chrome

View File

@ -12,7 +12,7 @@ function createMetaCompiler(cm) {
if (_cm !== cm) {
return;
}
const match = text.match(/\/\*\!?\s*==userstyle==[\s\S]*?==\/userstyle==\s*\*\//i);
const match = text.match(/\/\*!?\s*==userstyle==[\s\S]*?==\/userstyle==\s*\*\//i);
if (!match) {
return [];
}

View File

@ -245,10 +245,9 @@ function createSourceEditor({style, onTitleChanged}) {
.then(saved => saved !== code && messageBox.alert(t('syncStorageErrorSaving'))));
return;
}
}
contents[0] += ` (line ${pos.line + 1} col ${pos.ch + 1})`;
contents.push($create('pre', meta));
}
messageBox.alert(contents, 'pre');
});
}

View File

@ -10,7 +10,7 @@ const usercss = (() => {
// updateURL: 'updateUrl',
name: undefined,
};
const RX_META = /\/\*\!?\s*==userstyle==[\s\S]*?==\/userstyle==\s*\*\//i;
const RX_META = /\/\*!?\s*==userstyle==[\s\S]*?==\/userstyle==\s*\*\//i;
const ERR_ARGS_IS_LIST = new Set(['missingMandatory', 'missingChar']);
return {buildMeta, buildCode, assignVars};

View File

@ -144,7 +144,7 @@ function initPopup() {
info.appendChild(noteNode);
}
// Inaccessible locally hosted file type, e.g. JSON, PDF, etc.
if (tabURL.length - tabURL.lastIndexOf(".") <= 5) {
if (tabURL.length - tabURL.lastIndexOf('.') <= 5) {
info.appendChild($create('p', t('InaccessibleFileHint')));
}
document.body.classList.add('unreachable');

View File

@ -1,6 +1,6 @@
/* global tabURL handleEvent $ $$ prefs template FIREFOX chromeLocal debounce
$create t API tWordBreak formatDate tryCatch tryJSONparse LZString
ignoreChromeError */
ignoreChromeError download */
'use strict';
window.addEventListener('showStyles:done', function _() {