From 414609297d2bee133b4bf4789c27496e5ce0fdd2 Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 14 Nov 2020 10:11:32 +0300 Subject: [PATCH] eslint comma-dangle error + autofix files --- .eslintrc.yml | 2 +- background/background-worker.js | 14 ++++----- background/background.js | 12 +++---- background/content-scripts.js | 6 ++-- background/db-chrome-storage.js | 2 +- background/icon-manager.js | 8 ++--- background/icon-util.js | 4 +-- background/navigator-util.js | 4 +-- background/openusercss-api.js | 6 ++-- background/style-manager.js | 32 +++++++++---------- background/sync.js | 12 +++---- background/token-manager.js | 26 +++++++-------- background/usercss-helper.js | 2 +- content/install-hook-openusercss.js | 20 ++++++------ content/install-hook-userstyles.js | 6 ++-- edit/beautify.js | 4 +-- edit/codemirror-default.js | 4 +-- edit/codemirror-factory.js | 4 +-- edit/codemirror-themes.js | 6 ++-- edit/edit.js | 4 +-- edit/editor-worker.js | 4 +-- edit/global-search.js | 8 ++--- edit/linter-config-dialog.js | 2 +- edit/linter-defaults.js | 8 ++--- edit/linter-engines.js | 8 ++--- edit/linter-meta.js | 2 +- edit/linter-report.js | 8 ++--- edit/linter.js | 4 +-- edit/live-preview.js | 2 +- edit/moz-section-finder.js | 2 +- edit/moz-section-widget.js | 4 +-- edit/sections-editor.js | 2 +- edit/source-editor.js | 2 +- edit/util.js | 2 +- install-usercss/install-usercss.js | 6 ++-- js/cache.js | 2 +- js/dom.js | 2 +- js/messaging.js | 4 +-- js/meta-parser.js | 14 ++++----- js/usercss.js | 2 +- js/worker-util.js | 2 +- manage/config-dialog.js | 12 +++---- manage/filters.js | 2 +- manage/manage.js | 6 ++-- manage/sort.js | 18 +++++------ msgbox/msgbox.js | 6 ++-- popup/popup.js | 4 +-- popup/search-results.js | 4 +-- tools/build-vendor.js | 33 +++++++++++--------- tools/zip.js | 2 +- vendor-overwrites/colorpicker/colorpicker.js | 6 ++-- vendor-overwrites/csslint/parserlib.js | 4 +-- 52 files changed, 184 insertions(+), 181 deletions(-) diff --git a/.eslintrc.yml b/.eslintrc.yml index 44284461..c99504b4 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -19,7 +19,7 @@ rules: brace-style: [2, 1tbs, {allowSingleLine: false}] camelcase: [2, {properties: never}] class-methods-use-this: [2] - comma-dangle: [1, {arrays: always-multiline, objects: always-multiline}] + comma-dangle: [2, {arrays: always-multiline, objects: always-multiline}] comma-spacing: [2, {before: false, after: true}] comma-style: [2, last] complexity: [0] diff --git a/background/background-worker.js b/background/background-worker.js index 2b49eebd..7b30969c 100644 --- a/background/background-worker.js +++ b/background/background-worker.js @@ -25,7 +25,7 @@ workerUtil.createAPI({ '/js/meta-parser.js' ); return metaParser.nullifyInvalidVars(vars); - } + }, }); function compileUsercss(preprocessor, code, vars) { @@ -55,7 +55,7 @@ function compileUsercss(preprocessor, code, vars) { const va = vars[key]; output[key] = Object.assign({}, va, { value: va.value === null || va.value === undefined ? - getVarValue(va, 'default') : getVarValue(va, 'value') + getVarValue(va, 'default') : getVarValue(va, 'value'), }); return output; }, {}); @@ -86,7 +86,7 @@ function getUsercssCompiler(preprocessor) { section.code = varDef + section.code; } } - } + }, }, stylus: { preprocess(source, vars) { @@ -96,7 +96,7 @@ function getUsercssCompiler(preprocessor) { new self.StylusRenderer(varDef + source) .render((err, output) => err ? reject(err) : resolve(output)); }); - } + }, }, less: { preprocess(source, vars) { @@ -110,7 +110,7 @@ function getUsercssCompiler(preprocessor) { const varDefs = Object.keys(vars).map(key => `@${key}:${vars[key].value};\n`).join(''); return self.less.render(varDefs + source) .then(({css}) => css); - } + }, }, uso: { preprocess(source, vars) { @@ -162,8 +162,8 @@ function getUsercssCompiler(preprocessor) { return pool.get(name); }); } - } - } + }, + }, }; if (preprocessor) { diff --git a/background/background.js b/background/background.js index b1c1c20d..766222e6 100644 --- a/background/background.js +++ b/background/background.js @@ -8,7 +8,7 @@ // eslint-disable-next-line no-var var backgroundWorker = workerUtil.createWorker({ - url: '/background/background-worker.js' + url: '/background/background-worker.js', }); // eslint-disable-next-line no-var @@ -99,7 +99,7 @@ window.API_METHODS = Object.assign(window.API_METHODS || {}, { getSyncStatus: sync.getStatus, syncLogin: sync.login, - openManage + openManage, }); // ************************************************************************* @@ -119,7 +119,7 @@ if (FIREFOX) { navigatorUtil.onDOMContentLoaded(webNavIframeHelperFF, { url: [ {urlEquals: 'about:blank'}, - ] + ], }); } @@ -184,7 +184,7 @@ contextMenus = { msg.sendTab(tab.id, {method: 'editDeleteText'}, undefined, 'extension') .catch(msg.ignoreError); }, - } + }, }; async function createContextMenus(ids) { @@ -321,14 +321,14 @@ function openManage({options = false, search} = {}) { url, currentWindow: null, ignoreHash: true, - ignoreSearch: true + ignoreSearch: true, }) .then(tab => { if (tab) { return Promise.all([ activateTab(tab), (tab.pendingUrl || tab.url) !== url && msg.sendTab(tab.id, {method: 'pushState', url}) - .catch(console.error) + .catch(console.error), ]); } return getActiveTab().then(tab => { diff --git a/background/content-scripts.js b/background/content-scripts.js index 3aeecd16..23293097 100644 --- a/background/content-scripts.js +++ b/background/content-scripts.js @@ -29,7 +29,7 @@ const contentScripts = (() => { url: [ {hostEquals: 'greasyfork.org', urlMatches}, {hostEquals: 'sleazyfork.org', urlMatches}, - ] + ], }); return {injectToTab, injectToAllTabs}; @@ -57,7 +57,7 @@ const contentScripts = (() => { const options = { runAt: script.run_at, allFrames: script.all_frames, - matchAboutBlank: script.match_about_blank + matchAboutBlank: script.match_about_blank, }; if (frameId !== null) { options.allFrames = false; @@ -80,7 +80,7 @@ const contentScripts = (() => { } else { injectToTab({ url: tab.pendingUrl || tab.url, - tabId: tab.id + tabId: tab.id, }); } } diff --git a/background/db-chrome-storage.js b/background/db-chrome-storage.js index 01e38262..f3a67796 100644 --- a/background/db-chrome-storage.js +++ b/background/db-chrome-storage.js @@ -32,7 +32,7 @@ function createChromeStorageDB() { } } return output; - }) + }), }; return {exec}; diff --git a/background/icon-manager.js b/background/icon-manager.js index 0ea14d03..c69faa1b 100644 --- a/background/icon-manager.js +++ b/background/icon-manager.js @@ -13,7 +13,7 @@ const iconManager = (() => { ], () => debounce(refreshIconBadgeColor)); prefs.subscribe([ - 'show-badge' + 'show-badge', ], () => debounce(refreshAllIconsBadgeText)); prefs.subscribe([ @@ -79,7 +79,7 @@ const iconManager = (() => { tabManager.set(tabId, 'icon', newIcon); iconUtil.setIcon({ path: getIconPath(newIcon), - tabId + tabId, }); } @@ -103,14 +103,14 @@ const iconManager = (() => { function refreshGlobalIcon() { iconUtil.setIcon({ - path: getIconPath(getIconName()) + path: getIconPath(getIconName()), }); } function refreshIconBadgeColor() { const color = prefs.get(prefs.get('disableAll') ? 'badgeDisabled' : 'badgeNormal'); iconUtil.setBadgeBackgroundColor({ - color + color, }); } diff --git a/background/icon-util.js b/background/icon-util.js index ef7b2822..4bfffe31 100644 --- a/background/icon-util.js +++ b/background/icon-util.js @@ -19,7 +19,7 @@ const iconUtil = (() => { Cache imageData for paths */ setIcon, - setBadgeText + setBadgeText, }); function loadImage(url) { @@ -85,7 +85,7 @@ const iconUtil = (() => { return target[prop]; } return chrome.browserAction[prop].bind(chrome.browserAction); - } + }, }); } })(); diff --git a/background/navigator-util.js b/background/navigator-util.js index c1b702c6..ad73bf16 100644 --- a/background/navigator-util.js +++ b/background/navigator-util.js @@ -4,7 +4,7 @@ const navigatorUtil = (() => { const handler = { - urlChange: null + urlChange: null, }; return extendNative({onUrlChange}); @@ -69,7 +69,7 @@ const navigatorUtil = (() => { return target[prop]; } return chrome.webNavigation[prop].addListener.bind(chrome.webNavigation[prop]); - } + }, }); } })(); diff --git a/background/openusercss-api.js b/background/openusercss-api.js index 0ef98140..dfd890ff 100644 --- a/background/openusercss-api.js +++ b/background/openusercss-api.js @@ -31,11 +31,11 @@ return fetch(api, { method: 'POST', headers: new Headers({ - 'Content-Type': 'application/json' + 'Content-Type': 'application/json', }), body: query({ - id - }) + id, + }), }) .then(res => res.json()); }; diff --git a/background/style-manager.js b/background/style-manager.js index 0971b7af..569152f2 100644 --- a/background/style-manager.js +++ b/background/style-manager.js @@ -40,7 +40,7 @@ const styleManager = (() => { style.appliesTo.delete(url); } } - } + }, }); const BAD_MATCHER = {test: () => false}; @@ -60,7 +60,7 @@ const styleManager = (() => { protocol: '', search: '', searchParams: new URLSearchParams(), - username: '' + username: '', }; const DELETE_IF_NULL = ['id', 'customName']; @@ -68,7 +68,7 @@ const styleManager = (() => { handleLivePreviewConnections(); return Object.assign(/** @namespace styleManager */{ - compareRevision + compareRevision, }, ensurePrepared(/** @namespace styleManager */{ get, getByUUID, @@ -88,7 +88,7 @@ const styleManager = (() => { addExclusion, removeExclusion, addInclusion, - removeInclusion + removeInclusion, })); function handleLivePreviewConnections() { @@ -317,7 +317,7 @@ const styleManager = (() => { uuidIndex.delete(style.data._id); return msg.broadcast({ method: 'styleDeleted', - style: {id} + style: {id}, }); }) .then(() => id); @@ -348,7 +348,7 @@ const styleManager = (() => { md5Url: null, url: null, originalMd5: null, - installDate: Date.now() + installDate: Date.now(), }; } @@ -369,7 +369,7 @@ const styleManager = (() => { updated.add(url); cache.sections[data.id] = { id: data.id, - code + code, }; } } @@ -379,10 +379,10 @@ const styleManager = (() => { style: { id: data.id, md5Url: data.md5Url, - enabled: data.enabled + enabled: data.enabled, }, reason, - codeIsUpdated + codeIsUpdated, }); } @@ -425,7 +425,7 @@ const styleManager = (() => { if (!style) { styles.set(data.id, { appliesTo: new Set(), - data + data, }); method = 'styleAdded'; } else { @@ -473,7 +473,7 @@ const styleManager = (() => { result.push({ data: getStyleWithNoCode(data), excluded, - sloppy + sloppy, }); } } @@ -485,7 +485,7 @@ const styleManager = (() => { if (!cache) { cache = { sections: {}, - maybeMatch: new Set() + maybeMatch: new Set(), }; buildCache(styles.values()); cachedStyleForUrl.set(url, cache); @@ -511,7 +511,7 @@ const styleManager = (() => { if (code) { cache.sections[data.id] = { id: data.id, - code + code, }; appliesTo.add(url); } @@ -536,7 +536,7 @@ const styleManager = (() => { const ADD_MISSING_PROPS = { name: style => `ID: ${style.id}`, _id: () => uuidv4(), - _rev: () => Date.now() + _rev: () => Date.now(), }; return db.exec('getAll') @@ -560,7 +560,7 @@ const styleManager = (() => { fixUsoMd5Issue(style); styles.set(style.id, { appliesTo: new Set(), - data: style + data: style, }); uuidIndex.set(style._id, style.id); } @@ -706,7 +706,7 @@ const styleManager = (() => { domain = u.hostname; } return domain; - } + }, }; } diff --git a/background/sync.js b/background/sync.js index 052784d8..6581e732 100644 --- a/background/sync.js +++ b/background/sync.js @@ -13,7 +13,7 @@ const sync = (() => { progress: null, currentDriveName: null, errorMessage: null, - login: false + login: false, }; let currentDrive; const ctrl = dbToCloud.dbToCloud({ @@ -43,7 +43,7 @@ const sync = (() => { setState(drive, state) { const key = `sync/state/${drive.name}`; return chromeLocal.setValue(key, state); - } + }, }); const initializing = prefs.initializing.then(() => { @@ -58,7 +58,7 @@ const sync = (() => { }); return Object.assign({ - getStatus: () => status + getStatus: () => status, }, ensurePrepared({ start, stop, @@ -73,7 +73,7 @@ const sync = (() => { return ctrl.delete(...args); }, syncNow, - login + login, })); function ensurePrepared(obj) { @@ -99,7 +99,7 @@ const sync = (() => { function schedule(delay = SYNC_DELAY) { chrome.alarms.create('syncNow', { delayInMinutes: delay, - periodInMinutes: SYNC_INTERVAL + periodInMinutes: SYNC_INTERVAL, }); } @@ -206,7 +206,7 @@ const sync = (() => { function getDrive(name) { if (name === 'dropbox' || name === 'google' || name === 'onedrive') { return dbToCloud.drive[name]({ - getAccessToken: () => tokenManager.getToken(name) + getAccessToken: () => tokenManager.getToken(name), }); } throw new Error(`unknown cloud name: ${name}`); diff --git a/background/token-manager.js b/background/token-manager.js index b99b38b5..a5738e0f 100644 --- a/background/token-manager.js +++ b/background/token-manager.js @@ -13,9 +13,9 @@ const tokenManager = (() => { fetch('https://api.dropboxapi.com/2/auth/token/revoke', { method: 'POST', headers: { - 'Authorization': `Bearer ${token}` - } - }) + 'Authorization': `Bearer ${token}`, + }, + }), }, google: { flow: 'code', @@ -27,14 +27,14 @@ const tokenManager = (() => { // tokens for multiple machines. // https://stackoverflow.com/q/18519185 access_type: 'offline', - prompt: 'consent' + prompt: 'consent', }, tokenURL: 'https://oauth2.googleapis.com/token', scopes: ['https://www.googleapis.com/auth/drive.appdata'], revoke: token => { const params = {token}; return postQuery(`https://accounts.google.com/o/oauth2/revoke?${new URLSearchParams(params)}`); - } + }, }, onedrive: { flow: 'code', @@ -45,8 +45,8 @@ const tokenManager = (() => { redirect_uri: FIREFOX ? 'https://clngdbkpkpeebahjckkjfobafhncgmne.chromiumapp.org/' : 'https://' + location.hostname + '.chromiumapp.org/', - scopes: ['Files.ReadWrite.AppFolder', 'offline_access'] - } + scopes: ['Files.ReadWrite.AppFolder', 'offline_access'], + }, }; const NETWORK_LATENCY = 30; // seconds @@ -114,7 +114,7 @@ const tokenManager = (() => { client_id: provider.clientId, refresh_token: obj[k.REFRESH], grant_type: 'refresh_token', - scope: provider.scopes.join(' ') + scope: provider.scopes.join(' '), }; if (provider.clientSecret) { body.client_secret = provider.clientSecret; @@ -136,7 +136,7 @@ const tokenManager = (() => { response_type: provider.flow, client_id: provider.clientId, redirect_uri: provider.redirect_uri || chrome.identity.getRedirectURL(), - state + state, }; if (provider.scopes) { query.scope = provider.scopes.join(' '); @@ -148,7 +148,7 @@ const tokenManager = (() => { return webextLaunchWebAuthFlow({ url, interactive, - redirect_uri: query.redirect_uri + redirect_uri: query.redirect_uri, }) .then(url => { const params = new URLSearchParams( @@ -171,7 +171,7 @@ const tokenManager = (() => { code, grant_type: 'authorization_code', client_id: provider.clientId, - redirect_uri: query.redirect_uri + redirect_uri: query.redirect_uri, }; if (provider.clientSecret) { body.client_secret = provider.clientSecret; @@ -185,7 +185,7 @@ const tokenManager = (() => { return chromeLocal.set({ [k.TOKEN]: result.access_token, [k.EXPIRE]: result.expires_in ? Date.now() + (Number(result.expires_in) - NETWORK_LATENCY) * 1000 : undefined, - [k.REFRESH]: result.refresh_token + [k.REFRESH]: result.refresh_token, }) .then(() => result.access_token); } @@ -194,7 +194,7 @@ const tokenManager = (() => { const options = { method: 'POST', headers: { - 'Content-Type': 'application/x-www-form-urlencoded' + 'Content-Type': 'application/x-www-form-urlencoded', }, body: body ? new URLSearchParams(body) : null, }; diff --git a/background/usercss-helper.js b/background/usercss-helper.js index 58dc2233..acb1e1af 100644 --- a/background/usercss-helper.js +++ b/background/usercss-helper.js @@ -61,7 +61,7 @@ const usercssHelper = (() => { find(styleId ? {id: styleId} : style) : Promise.resolve(); return Promise.all([ metaOnly ? style : doBuild(style, findDup), - findDup + findDup, ]); }) .then(([style, dup]) => ({style, dup})); diff --git a/content/install-hook-openusercss.js b/content/install-hook-openusercss.js index 31defada..f85fb4da 100644 --- a/content/install-hook-openusercss.js +++ b/content/install-hook-openusercss.js @@ -5,7 +5,7 @@ const manifest = chrome.runtime.getManifest(); const allowedOrigins = [ 'https://openusercss.org', - 'https://openusercss.com' + 'https://openusercss.com', ]; const sendPostMessage = message => { @@ -17,7 +17,7 @@ const askHandshake = () => { // Tell the page that we exist and that it should send the handshake sendPostMessage({ - type: 'ouc-begin-handshake' + type: 'ouc-begin-handshake', }); }; @@ -25,7 +25,7 @@ const sendInstalledCallback = styleData => { sendPostMessage({ type: 'ouc-is-installed-response', - style: styleData + style: styleData, }); }; @@ -36,14 +36,14 @@ ) { API.findUsercss({ name: event.data.name, - namespace: event.data.namespace + namespace: event.data.namespace, }).then(style => { const data = {event}; const callbackObject = { installed: Boolean(style), enabled: style.enabled, name: data.name, - namespace: data.namespace + namespace: data.namespace, }; sendInstalledCallback(callbackObject); @@ -71,7 +71,7 @@ 'update-auto', 'export-json-backups', 'import-json-backups', - 'manage-local' + 'manage-local', ]; const reportedFeatures = []; @@ -96,8 +96,8 @@ key: event.data.key, extension: { name: manifest.name, - capabilities: reportedFeatures - } + capabilities: reportedFeatures, + }, }); }; @@ -120,7 +120,7 @@ // we were able to install the theme and it may display a success message sendPostMessage({ type: 'ouc-install-callback', - key: data.key + key: data.key, }); }; @@ -135,7 +135,7 @@ }).then(style => { sendInstallCallback({ enabled: style.enabled, - key: event.data.key + key: event.data.key, }); }); } diff --git a/content/install-hook-userstyles.js b/content/install-hook-userstyles.js index f01f1a8f..1a5f4842 100644 --- a/content/install-hook-userstyles.js +++ b/content/install-hook-userstyles.js @@ -85,7 +85,7 @@ const observer = new MutationObserver(check); observer.observe(document.documentElement, { childList: true, - subtree: true + subtree: true, }); check(); @@ -105,7 +105,7 @@ ? 'styleCanBeUpdatedChrome' : 'styleAlreadyInstalledChrome', detail: { - updateUrl: installedStyle.updateUrl + updateUrl: installedStyle.updateUrl, }, }); }); @@ -155,7 +155,7 @@ function doInstall() { let oldStyle; return API.findStyle({ - md5Url: getMeta('stylish-md5-url') || location.href + md5Url: getMeta('stylish-md5-url') || location.href, }, true) .then(_oldStyle => { oldStyle = _oldStyle; diff --git a/edit/beautify.js b/edit/beautify.js index 0f097fce..af4d5cf2 100644 --- a/edit/beautify.js +++ b/edit/beautify.js @@ -162,7 +162,7 @@ function beautify(scope, ui = true) { $create('SVG:path', { 'fill-rule': 'evenodd', 'd': 'M1408 704q0 26-19 45l-448 448q-19 19-45 ' + - '19t-45-19l-448-448q-19-19-19-45t19-45 45-19h896q26 0 45 19t19 45z' + '19t-45-19l-448-448q-19-19-19-45t19-45 45-19h896q26 0 45 19t19 45z', }), ]), ]), @@ -176,7 +176,7 @@ function beautify(scope, ui = true) { $create('input', { type: 'checkbox', dataset: {option: optionName}, - checked: options[optionName] !== false + checked: options[optionName] !== false, }), $create('SVG:svg.svg-icon.checked', $create('SVG:use', {'xlink:href': '#svg-icon-checked'})), diff --git a/edit/codemirror-default.js b/edit/codemirror-default.js index ff2f51a8..ca600532 100644 --- a/edit/codemirror-default.js +++ b/edit/codemirror-default.js @@ -82,7 +82,7 @@ [ {from: 'Ctrl-', to: ['Alt-', 'Ctrl-Alt-']}, // Note: modifier order in CodeMirror is S-C-A - {from: 'Shift-Ctrl-', to: ['Ctrl-Alt-', 'Shift-Ctrl-Alt-']} + {from: 'Shift-Ctrl-', to: ['Ctrl-Alt-', 'Shift-Ctrl-Alt-']}, ].forEach(remap => { const oldKey = remap.from + char; Object.keys(CodeMirror.keyMap).forEach(keyMapName => { @@ -134,7 +134,7 @@ let filled; this.eachLine(({text}) => (filled = text && /\S/.test(text))); return !filled; - } + }, }); // editor commands diff --git a/edit/codemirror-factory.js b/edit/codemirror-factory.js index 887e6c08..4d30ddf4 100644 --- a/edit/codemirror-factory.js +++ b/edit/codemirror-factory.js @@ -33,13 +33,13 @@ const cmFactory = (() => { cm.setOption('highlightSelectionMatches', { showToken: /[#.\-\w]/, annotateScrollbar: true, - onUpdate: updateMatchHighlightCount + onUpdate: updateMatchHighlightCount, }); } else if (value === 'selection') { cm.setOption('highlightSelectionMatches', { showToken: false, annotateScrollbar: true, - onUpdate: updateMatchHighlightCount + onUpdate: updateMatchHighlightCount, }); } else { cm.setOption('highlightSelectionMatches', null); diff --git a/edit/codemirror-themes.js b/edit/codemirror-themes.js index d9e25d19..aa3628c1 100644 --- a/edit/codemirror-themes.js +++ b/edit/codemirror-themes.js @@ -1,7 +1,7 @@ -/* exported CODEMIRROR_THEMES */ -// this file is generated by update-codemirror-themes.js +/* Do not edit. This file is auto-generated by build-vendor.js */ 'use strict'; +/* exported CODEMIRROR_THEMES */ const CODEMIRROR_THEMES = [ '3024-day', '3024-night', @@ -65,5 +65,5 @@ const CODEMIRROR_THEMES = [ 'xq-light', 'yeti', 'yonce', - 'zenburn' + 'zenburn', ]; diff --git a/edit/edit.js b/edit/edit.js index 0b5c89c8..2e75d867 100644 --- a/edit/edit.js +++ b/edit/edit.js @@ -72,7 +72,7 @@ lazyInit(); cm.scrollIntoView(cm.getCursor(), si.parentHeight / 2); }); } - } + }, }); prefs.subscribe('editor.linter', updateLinter); prefs.subscribe('editor.keyMap', showHotkeyInTooltip); @@ -512,7 +512,7 @@ function showCodeMirrorPopup(title, html, options) { matchBrackets: true, styleActiveLine: true, theme: prefs.get('editor.theme'), - keyMap: prefs.get('editor.keyMap') + keyMap: prefs.get('editor.keyMap'), }, options)); cm.focus(); rerouteHotkeys(false); diff --git a/edit/editor-worker.js b/edit/editor-worker.js index 9dd1b368..9a0ec6fd 100644 --- a/edit/editor-worker.js +++ b/edit/editor-worker.js @@ -29,13 +29,13 @@ workerUtil.createAPI({ code: err.code, args: err.args, message: err.message, - index: err.index + index: err.index, }) ); return result; }, getStylelintRules, - getCsslintRules + getCsslintRules, }); function getCsslintRules() { diff --git a/edit/global-search.js b/edit/global-search.js index 546805c5..68cd2edc 100644 --- a/edit/global-search.js +++ b/edit/global-search.js @@ -100,7 +100,7 @@ onDOMready().then(() => { state.lastFind = ''; toggleDataset(this, 'enabled', !state.icase); doSearch({canAdvance: false}); - } + }, }, }; @@ -136,7 +136,7 @@ onDOMready().then(() => { trimUndoHistory(); enableUndoButton(state.undoHistory.length); if (state.find) doSearch({canAdvance: false}); - } + }, }; const DIALOG_PROPS = { @@ -152,7 +152,7 @@ onDOMready().then(() => { state.replace = this.value; adjustTextareaSize(this); debounce(writeStorage, STORAGE_UPDATE_DELAY); - } + }, }, }; @@ -169,7 +169,7 @@ onDOMready().then(() => { replace(cm) { state.reverse = false; focusDialog('replace', cm); - } + }, }; COMMANDS.replaceAll = COMMANDS.replace; diff --git a/edit/linter-config-dialog.js b/edit/linter-config-dialog.js index d357cb79..5168e86b 100644 --- a/edit/linter-config-dialog.js +++ b/edit/linter-config-dialog.js @@ -61,7 +61,7 @@ loadScript([ '/vendor/codemirror/mode/javascript/javascript.js', '/vendor/codemirror/addon/lint/json-lint.js', - '/vendor/jsonlint/jsonlint.js' + '/vendor/jsonlint/jsonlint.js', ]).then(() => { cm.setOption('mode', 'application/json'); cm.setOption('lint', true); diff --git a/edit/linter-defaults.js b/edit/linter-defaults.js index 4d1d6aee..6c2dd09b 100644 --- a/edit/linter-defaults.js +++ b/edit/linter-defaults.js @@ -12,13 +12,13 @@ const LINTER_DEFAULTS = (() => { rules: { 'at-rule-no-unknown': [true, { 'ignoreAtRules': ['extend', 'extends', 'css', 'block'], - 'severity': 'warning' + 'severity': 'warning', }], 'block-no-empty': [true, SEVERITY], 'color-no-invalid-hex': [true, SEVERITY], 'declaration-block-no-duplicate-properties': [true, { 'ignore': ['consecutive-duplicates-with-different-values'], - 'severity': 'warning' + 'severity': 'warning', }], 'declaration-block-no-shorthand-property-overrides': [true, SEVERITY], 'font-family-no-duplicate-names': [true, SEVERITY], @@ -172,7 +172,7 @@ const LINTER_DEFAULTS = (() => { 'value-list-comma-space-before': 'never', 'value-list-max-empty-lines': 0 */ - } + }, }; const CSSLINT = { // Default warnings @@ -216,7 +216,7 @@ const LINTER_DEFAULTS = (() => { 'universal-selector': 0, 'unqualified-attributes': 0, 'vendor-prefix': 0, - 'zero-units': 0 + 'zero-units': 0, }; return {STYLELINT, CSSLINT, SEVERITY}; })(); diff --git a/edit/linter-engines.js b/edit/linter-engines.js index 8ec09144..295e5d32 100644 --- a/edit/linter-engines.js +++ b/edit/linter-engines.js @@ -7,7 +7,7 @@ storageName: chromeSync.LZ_KEY.csslint, lint: csslint, validMode: mode => mode === 'css', - getConfig: config => Object.assign({}, LINTER_DEFAULTS.CSSLINT, config) + getConfig: config => Object.assign({}, LINTER_DEFAULTS.CSSLINT, config), }, stylelint: { storageName: chromeSync.LZ_KEY.stylelint, @@ -15,9 +15,9 @@ validMode: () => true, getConfig: config => ({ syntax: 'sugarss', - rules: Object.assign({}, LINTER_DEFAULTS.STYLELINT.rules, config && config.rules) - }) - } + rules: Object.assign({}, LINTER_DEFAULTS.STYLELINT.rules, config && config.rules), + }), + }, }); async function stylelint(text, config, mode) { diff --git a/edit/linter-meta.js b/edit/linter-meta.js index 0068771a..bee0b5e5 100644 --- a/edit/linter-meta.js +++ b/edit/linter-meta.js @@ -33,7 +33,7 @@ function createMetaCompiler(cm, onUpdated) { to: cm.posFromIndex((err.index || 0) + match.index), message: err.code && chrome.i18n.getMessage(`meta_${err.code}`, err.args) || err.message, severity: err.code === 'unknownMeta' ? 'warning' : 'error', - rule: err.code + rule: err.code, }) ); meta = match[0]; diff --git a/edit/linter-report.js b/edit/linter-report.js index 4387cb76..b3aea52b 100644 --- a/edit/linter-report.js +++ b/edit/linter-report.js @@ -77,7 +77,7 @@ Object.assign(linter, (() => { element: table, trs, updateAnnotations, - updateCaption + updateCaption, }; function updateCaption() { @@ -124,18 +124,18 @@ Object.assign(linter, (() => { const message = $create('td', {attributes: {role: 'message'}}); const trElement = $create('tr', { - onclick: () => gotoLintIssue(cm, anno) + onclick: () => gotoLintIssue(cm, anno), }, [ severity, line, $create('td', {attributes: {role: 'sep'}}, ':'), col, - message + message, ]); return { element: trElement, update, - getAnnotation: () => anno + getAnnotation: () => anno, }; function update(_anno) { diff --git a/edit/linter.js b/edit/linter.js index 607eb057..52a525b8 100644 --- a/edit/linter.js +++ b/edit/linter.js @@ -3,7 +3,7 @@ /* exported editorWorker */ const editorWorker = workerUtil.createWorker({ - url: '/edit/editor-worker.js' + url: '/edit/editor-worker.js', }); /* exported linter */ @@ -19,7 +19,7 @@ const linter = (() => { enableForEditor, disableForEditor, onLintingUpdated, - onUnhook + onUnhook, }; function onUnhook(cb) { diff --git a/edit/live-preview.js b/edit/live-preview.js index 34bf13be..fafaa50f 100644 --- a/edit/live-preview.js +++ b/edit/live-preview.js @@ -40,7 +40,7 @@ function createLivePreview(preprocess, shouldShow) { function createPreviewer() { const port = chrome.runtime.connect({ - name: 'livePreview' + name: 'livePreview', }); port.onDisconnect.addListener(err => { throw err; diff --git a/edit/moz-section-finder.js b/edit/moz-section-finder.js index e80fbb12..9d143993 100644 --- a/edit/moz-section-finder.js +++ b/edit/moz-section-finder.js @@ -75,7 +75,7 @@ function MozSectionFinder(cm) { /** @param {MozSection} [section] */ updatePositions(section) { (section ? [section] : getState().sections).forEach(setPositionFromMark); - } + }, }; return MozSectionFinder; diff --git a/edit/moz-section-widget.js b/edit/moz-section-widget.js index e8f4cfe3..3526874f 100644 --- a/edit/moz-section-widget.js +++ b/edit/moz-section-widget.js @@ -74,7 +74,7 @@ function MozSectionWidget( if (funcs.length < 2) { messageBox({ contents: t('appliesRemoveError'), - buttons: [t('confirmClose')] + buttons: [t('confirmClose')], }); return; } @@ -125,7 +125,7 @@ function MozSectionWidget( return; } } - } + }, }; actualStyle = $create('style'); diff --git a/edit/sections-editor.js b/edit/sections-editor.js index 80bf791c..09cc5ec2 100644 --- a/edit/sections-editor.js +++ b/edit/sections-editor.js @@ -436,7 +436,7 @@ function SectionsEditor() { /** @returns {Style} */ function getModel() { return Object.assign({}, style, { - sections: sections.filter(s => !s.removed).map(s => s.getModel()) + sections: sections.filter(s => !s.removed).map(s => s.getModel()), }); } diff --git a/edit/source-editor.js b/edit/source-editor.js index 8cafc93d..48272e17 100644 --- a/edit/source-editor.js +++ b/edit/source-editor.js @@ -99,7 +99,7 @@ function SourceEditor() { return API.buildUsercss({ styleId: style.id, sourceCode: style.sourceCode, - assignVars: true + assignVars: true, }) .then(({style: newStyle}) => { delete newStyle.enabled; diff --git a/edit/util.js b/edit/util.js index 8af544de..f987e601 100644 --- a/edit/util.js +++ b/edit/util.js @@ -214,6 +214,6 @@ function createHotkeyInput(prefId, onDone = () => {}) { }, onpaste(event) { event.preventDefault(); - } + }, }); } diff --git a/install-usercss/install-usercss.js b/install-usercss/install-usercss.js index fa6c6aa3..56afae69 100644 --- a/install-usercss/install-usercss.js +++ b/install-usercss/install-usercss.js @@ -22,7 +22,7 @@ if (theme !== 'default') { document.head.appendChild($create('link', { rel: 'stylesheet', - href: `vendor/codemirror/theme/${theme}.css` + href: `vendor/codemirror/theme/${theme}.css`, })); } window.addEventListener('resize', adjustCodeHeight); @@ -111,7 +111,7 @@ frag.appendChild($createLink(url, $create('SVG:svg.svg-icon', {viewBox: '0 0 20 20'}, $create('SVG:path', { - d: 'M4,4h5v2H6v8h8v-3h2v5H4V4z M11,3h6v6l-2-2l-4,4L9,9l4-4L11,3z' + d: 'M4,4h5v2H6v8h8v-3h2v5H4V4z M11,3h6v6l-2-2l-4,4L9,9l4-4L11,3z', })) )); } @@ -130,7 +130,7 @@ $create('li', $createLink(...args) ) - )) + )), ])); } } diff --git a/js/cache.js b/js/cache.js index 07acfd06..3b6abd73 100644 --- a/js/cache.js +++ b/js/cache.js @@ -25,7 +25,7 @@ function createCache({size = 1000, onDeleted} = {}) { }, get size() { return map.size; - } + }, }; function get(id) { diff --git a/js/dom.js b/js/dom.js index d8bafda8..74649ab4 100644 --- a/js/dom.js +++ b/js/dom.js @@ -296,7 +296,7 @@ function $createLink(href = '', content) { const opt = { tag: 'a', target: '_blank', - rel: 'noopener' + rel: 'noopener', }; if (typeof href === 'object') { Object.assign(opt, href); diff --git a/js/messaging.js b/js/messaging.js index 9067ee87..c713d3e5 100644 --- a/js/messaging.js +++ b/js/messaging.js @@ -126,7 +126,7 @@ function urlToMatchPattern(url, ignoreSearch) { if (ignoreSearch) { return [ `${url.protocol}//${url.hostname}/${url.pathname}`, - `${url.protocol}//${url.hostname}/${url.pathname}?*` + `${url.protocol}//${url.hostname}/${url.pathname}?*`, ]; } // FIXME: is %2f allowed in pathname and search? @@ -220,7 +220,7 @@ function activateTab(tab, {url, index, openerTabId} = {}) { return Promise.all([ browser.tabs.update(tab.id, options), browser.windows && browser.windows.update(tab.windowId, {focused: true}), - index != null && browser.tabs.move(tab.id, {index}) + index != null && browser.tabs.move(tab.id, {index}), ]) .then(() => tab); } diff --git a/js/meta-parser.js b/js/meta-parser.js index 2f5bec83..246c2996 100644 --- a/js/meta-parser.js +++ b/js/meta-parser.js @@ -12,17 +12,17 @@ const metaParser = (() => { throw new ParseError({ code: 'unknownPreprocessor', args: [state.value], - index: state.valueIndex + index: state.valueIndex, }); } - } + }, }, validateVar: { select: state => { if (state.varResult.options.every(o => o.name !== state.value)) { throw new ParseError({ code: 'invalidSelectValueMismatch', - index: state.valueIndex + index: state.valueIndex, }); } }, @@ -32,19 +32,19 @@ const metaParser = (() => { throw new ParseError({ code: 'invalidColor', args: [state.value], - index: state.valueIndex + index: state.valueIndex, }); } state.value = colorConverter.format(color, 'rgb'); - } - } + }, + }, }; const parser = createParser(options); const looseParser = createParser(Object.assign({}, options, {allowErrors: true, unknownKey: 'throw'})); return { parse, lint, - nullifyInvalidVars + nullifyInvalidVars, }; function parse(text, indexOffset) { diff --git a/js/usercss.js b/js/usercss.js index b2afea36..7f2742e1 100644 --- a/js/usercss.js +++ b/js/usercss.js @@ -20,7 +20,7 @@ const usercss = (() => { const style = { enabled: true, sourceCode, - sections: [] + sections: [], }; const match = sourceCode.match(RX_META); diff --git a/js/worker-util.js b/js/worker-util.js index 5ba40232..767502e6 100644 --- a/js/worker-util.js +++ b/js/worker-util.js @@ -67,7 +67,7 @@ const workerUtil = { message: err.message, lineNumber: err.lineNumber, columnNumber: err.columnNumber, - fileName: err.fileName + fileName: err.fileName, }, err); }, diff --git a/manage/config-dialog.js b/manage/config-dialog.js index 756a12ce..8d5d1751 100644 --- a/manage/config-dialog.js +++ b/manage/config-dialog.js @@ -28,7 +28,7 @@ function configDialog(style) { contents: [ $create('.config-heading', data.supportURL && $createLink({className: '.external-support', href: data.supportURL}, t('externalFeedback'))), - $create('.config-body', elements) + $create('.config-body', elements), ], buttons: [{ textContent: t('confirmSave'), @@ -210,8 +210,8 @@ function configDialog(style) { $create('SVG:polygon', { points: '16.2,5.5 14.5,3.8 10,8.3 5.5,3.8 3.8,5.5 8.3,10 3.8,14.5 ' + '5.5,16.2 10,11.7 14.5,16.2 16.2,14.5 11.7,10', - }) - ]) + }), + ]), ]); for (const va of vars) { let children; @@ -222,7 +222,7 @@ function configDialog(style) { va.input = $create('a.color-swatch', { va, href: '#', - onclick: showColorpicker + onclick: showColorpicker, }), ]), ]; @@ -268,7 +268,7 @@ function configDialog(style) { onblur: va.type === 'number' ? updateVarOnBlur : null, onchange: updateVarOnChange, oninput: updateVarOnInput, - required: true + required: true, }; if (typeof va.min === 'number') { options.min = va.min; @@ -281,7 +281,7 @@ function configDialog(style) { } children = [ va.type === 'range' && $create('span.current-value'), - va.input = $create('input.config-value', options) + va.input = $create('input.config-value', options), ]; break; } diff --git a/manage/filters.js b/manage/filters.js index 3d670dfe..fcb7fc62 100644 --- a/manage/filters.js +++ b/manage/filters.js @@ -157,7 +157,7 @@ function filterOnChange({target: el, forceRefilter}) { el.dataset[hide ? 'filterHide' : 'filter'] .split(/,\s*/) .map(s => (hide ? '.entry:not(.hidden)' : '') + s) - .join(',')) + .join(',')), ].join(hide ? ',' : ''); Object.assign(filtersSelector, { hide: buildFilter(true), diff --git a/manage/manage.js b/manage/manage.js index 326b2a16..813ad815 100644 --- a/manage/manage.js +++ b/manage/manage.js @@ -71,7 +71,7 @@ Promise.all([ // FIXME: integrate this into filter.js router.getSearch('search') && API.searchDB({query: router.getSearch('search')}), waitForSelector('#installed'), // needed to avoid flicker due to an extra frame and layout shift - prefs.initializing + prefs.initializing, ]).then(([styles, ids, el]) => { installed = el; installed.onclick = handleEvent.entryClicked; @@ -370,7 +370,7 @@ Object.assign(handleEvent, { '.update': 'update', '.delete': 'delete', '.applies-to .expander': 'expandTargets', - '.configure-usercss': 'config' + '.configure-usercss': 'config', }, entryClicked(event) { @@ -526,7 +526,7 @@ Object.assign(handleEvent, { {prop: 'updateDate', name: 'dateUpdated'}, ].map(({prop, name}) => t(name) + ': ' + (formatDate(entry.styleMeta[prop]) || '—')).join('\n'); - } + }, }); diff --git a/manage/sort.js b/manage/sort.js index 17454424..a55d2176 100644 --- a/manage/sort.js +++ b/manage/sort.js @@ -13,28 +13,28 @@ const sorter = (() => { title: { text: t('genericTitle'), parse: ({name}) => name, - sorter: sorterType.alpha + sorter: sorterType.alpha, }, usercss: { text: 'Usercss', parse: ({style}) => style.usercssData ? 0 : 1, - sorter: sorterType.number + sorter: sorterType.number, }, disabled: { text: '', // added as either "enabled" or "disabled" by the addOptions function parse: ({style}) => style.enabled ? 1 : 0, - sorter: sorterType.number + sorter: sorterType.number, }, dateInstalled: { text: t('dateInstalled'), parse: ({style}) => style.installDate, - sorter: sorterType.number + sorter: sorterType.number, }, dateUpdated: { text: t('dateUpdated'), parse: ({style}) => style.updateDate || style.installDate, - sorter: sorterType.number - } + sorter: sorterType.number, + }, }; // Adding (assumed) most commonly used ('title,asc' should always be first) @@ -56,7 +56,7 @@ const sorter = (() => { 'usercss,asc, title,desc', 'usercss,desc, title,desc', 'disabled,desc, title,desc', - 'disabled,desc, usercss,asc, title,desc' + 'disabled,desc, usercss,asc, title,desc', ]; const splitRegex = /\s*,\s*/; @@ -76,7 +76,7 @@ const sorter = (() => { dateNew: ` (${t('sortDateNewestFirst')})`, dateOld: ` (${t('sortDateOldestFirst')})`, groupAsc: t('sortLabelTitleAsc'), - groupDesc: t('sortLabelTitleDesc') + groupDesc: t('sortLabelTitleDesc'), }; const optgroupRegex = /\{\w+\}/; selectOptions.forEach(sort => { @@ -132,7 +132,7 @@ const sorter = (() => { entry, name: entry.styleNameLowerCase, style: entry.styleMeta, - })) + })), }); if (current.some((entry, index) => entry !== sorted[index].entry)) { const renderBin = document.createDocumentFragment(); diff --git a/msgbox/msgbox.js b/msgbox/msgbox.js index 69a8edcc..f9d2579b 100644 --- a/msgbox/msgbox.js +++ b/msgbox/msgbox.js @@ -87,7 +87,7 @@ function messageBox({ }, scroll() { scrollTo(blockScroll.x, blockScroll.y); - } + }, }; } @@ -160,7 +160,7 @@ messageBox.alert = (contents, className, title) => title, contents, className: `center ${className || ''}`, - buttons: [t('confirmClose')] + buttons: [t('confirmClose')], }); /** @@ -174,5 +174,5 @@ messageBox.confirm = (contents, className, title) => title, contents, className: `center ${className || ''}`, - buttons: [t('confirmYes'), t('confirmNo')] + buttons: [t('confirmYes'), t('confirmNo')], }).then(result => result.button === 0 || result.enter); diff --git a/popup/popup.js b/popup/popup.js index 7a7fc9a5..899231ad 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -344,7 +344,7 @@ function createStyleElement(style) { styleId: style.id, styleIsUsercss: Boolean(style.usercssData), onmousedown: handleEvent.maybeEdit, - styleMeta: style + styleMeta: style, }); const checkbox = $('.checker', entry); Object.assign(checkbox, { @@ -645,7 +645,7 @@ Object.assign(handleEvent, { this.eventHandled = true; API.openManage({ search: tabURL && (event.shiftKey || event.button === 2) ? - `url:${tabURL}` : null + `url:${tabURL}` : null, }); window.close(); } diff --git a/popup/search-results.js b/popup/search-results.js index 0b35e39c..3036145d 100755 --- a/popup/search-results.js +++ b/popup/search-results.js @@ -273,7 +273,7 @@ window.addEventListener('showStyles:done', () => { // title Object.assign($('.search-result-title', entry), { onclick: handleEvent.openURLandHide, - href: URLS.usoArchive + `?category=${category}&style=${id}` + href: URLS.usoArchive + `?category=${category}&style=${id}`, }); $('.search-result-title span', entry).textContent = tWordBreak(name.length < 300 ? name : name.slice(0, 300) + '...'); @@ -303,7 +303,7 @@ window.addEventListener('showStyles:done', () => { // time Object.assign($('[data-type="updated"] time', entry), { dateTime: updateTime * 1000, - textContent: formatDate(updateTime * 1000) + textContent: formatDate(updateTime * 1000), }); // totals $('[data-type="weekly"] dd', entry).textContent = formatNumber(weeklyInstalls); diff --git a/tools/build-vendor.js b/tools/build-vendor.js index 8ebf6512..449ed144 100644 --- a/tools/build-vendor.js +++ b/tools/build-vendor.js @@ -32,37 +32,37 @@ const files = { 'mode/css', 'mode/javascript', 'mode/stylus', - 'theme/*' + 'theme/*', ], 'jsonlint': [ 'lib/jsonlint.js → jsonlint.js', - 'README.md → LICENSE' + 'README.md → LICENSE', ], 'less-bundle': [ - 'dist/less.min.js → less.min.js' + 'dist/less.min.js → less.min.js', ], 'lz-string-unsafe': [ - 'lz-string-unsafe.min.js' + 'lz-string-unsafe.min.js', ], 'semver-bundle': [ - 'dist/semver.js → semver.js' + 'dist/semver.js → semver.js', ], 'stylelint-bundle': [ 'stylelint-bundle.min.js', - 'https://github.com/stylelint/stylelint/raw/{VERSION}/LICENSE → LICENSE' + 'https://github.com/stylelint/stylelint/raw/{VERSION}/LICENSE → LICENSE', ], 'stylus-lang-bundle': [ - 'dist/stylus-renderer.min.js → stylus-renderer.min.js' + 'dist/stylus-renderer.min.js → stylus-renderer.min.js', ], 'usercss-meta': [ - 'dist/usercss-meta.min.js → usercss-meta.min.js' + 'dist/usercss-meta.min.js → usercss-meta.min.js', ], 'db-to-cloud': [ - 'dist/db-to-cloud.min.js → db-to-cloud.min.js' + 'dist/db-to-cloud.min.js → db-to-cloud.min.js', ], 'webext-launch-web-auth-flow': [ - 'dist/webext-launch-web-auth-flow.min.js → webext-launch-web-auth-flow.min.js' - ] + 'dist/webext-launch-web-auth-flow.min.js → webext-launch-web-auth-flow.min.js', + ], }; main().catch(console.error); @@ -87,12 +87,15 @@ async function generateThemeList() { .map(name => name.replace('.css', '')) .sort(); return endent` - /* exported CODEMIRROR_THEMES */ - // this file is generated by update-codemirror-themes.js + /* Do not edit. This file is auto-generated by build-vendor.js */ 'use strict'; - const CODEMIRROR_THEMES = ${JSON.stringify(themes, null, 2)}; - `.replace(/"/g, "'") + '\n'; + /* exported CODEMIRROR_THEMES */ + const CODEMIRROR_THEMES = [ + ${ + themes.map(t => ` '${t.replace(/'/g, '\\$&')}',\n`).join('') + }]; + ` + '\n'; } async function copyLicense(pkg) { diff --git a/tools/zip.js b/tools/zip.js index bd2ff830..5d975536 100644 --- a/tools/zip.js +++ b/tools/zip.js @@ -16,7 +16,7 @@ function createZip({isFirefox} = {}) { 'package-lock.json', 'yarn.lock', '*.zip', - '*.map' + '*.map', ]; const file = fs.createWriteStream(fileName); diff --git a/vendor-overwrites/colorpicker/colorpicker.js b/vendor-overwrites/colorpicker/colorpicker.js index 60cb2ed6..f56d3dbd 100644 --- a/vendor-overwrites/colorpicker/colorpicker.js +++ b/vendor-overwrites/colorpicker/colorpicker.js @@ -12,7 +12,7 @@ {hex: '#00ffff', start: .50}, {hex: '#0000ff', start: .67}, {hex: '#ff00ff', start: .83}, - {hex: '#ff0000', start: 1} + {hex: '#ff0000', start: 1}, ]; const MIN_HEIGHT = 220; const MARGIN = 8; @@ -119,7 +119,7 @@ $inputGroups.hex = $(['input-group', 'hex'], [ $(['input-field', 'hex'], [ $hexCode = $('input', {tag: 'input', type: 'text', spellcheck: false, - pattern: /^\s*#([a-fA-F\d]{3}([a-fA-F\d]([a-fA-F\d]{2}([a-fA-F\d]{2})?)?)?)\s*$/.source + pattern: /^\s*#([a-fA-F\d]{3}([a-fA-F\d]([a-fA-F\d]{2}([a-fA-F\d]{2})?)?)?)\s*$/.source, }), $('title', [ $hexLettercase.true = $('title-action', {onclick: onHexLettercaseClicked}, 'HEX'), @@ -186,7 +186,7 @@ Object.defineProperty($inputs.hsl, 'color', {get: inputsToHSL}); Object.defineProperty($inputs, 'color', {get: () => $inputs[currentFormat].color}); Object.defineProperty($inputs, 'colorString', { - get: () => currentFormat && colorConverter.format($inputs[currentFormat].color) + get: () => currentFormat && colorConverter.format($inputs[currentFormat].color), }); HUE_COLORS.forEach(color => Object.assign(color, colorConverter.parse(color.hex))); diff --git a/vendor-overwrites/csslint/parserlib.js b/vendor-overwrites/csslint/parserlib.js index c364f72b..6618d4a3 100644 --- a/vendor-overwrites/csslint/parserlib.js +++ b/vendor-overwrites/csslint/parserlib.js @@ -2057,7 +2057,7 @@ self.parserlib = (() => { return m.toString(p); }).join(required === false ? ' || ' : ' && '); return prec > p ? `[ ${s} ]` : s; - } + }, }; Matcher.parseGrammar = (() => { @@ -5300,7 +5300,7 @@ self.parserlib = (() => { _readDeclarations({ checkStart = true, readMargins = false, - stopAfterBrace = false + stopAfterBrace = false, } = {}) { const stream = this._tokenStream; if (checkStart) stream.mustMatch(Tokens.LBRACE);