aboutsummaryrefslogtreecommitdiff
path: root/ext/js/background
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-12-16 20:04:56 -0500
committerGitHub <noreply@github.com>2023-12-17 01:04:56 +0000
commitb249627434d3a94420ac4d98c3ce720767e57b43 (patch)
treeec46e2c020c5a63a5c2babf56376f53e288ed7f2 /ext/js/background
parentdecbc60f7734e739c0e5c41da294f65f9eec92fe (diff)
Update eslint spacing rules (#366)
* Add space-infix-ops rule * Add no-multi-spaces --------- Co-authored-by: Darius Jahandarie <djahandarie@gmail.com>
Diffstat (limited to 'ext/js/background')
-rw-r--r--ext/js/background/backend.js14
-rw-r--r--ext/js/background/offscreen.js2
-rw-r--r--ext/js/background/profile-conditions-util.js10
3 files changed, 15 insertions, 11 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js
index 3eefed53..749c81a6 100644
--- a/ext/js/background/backend.js
+++ b/ext/js/background/backend.js
@@ -147,6 +147,7 @@ export class Backend {
/** @type {PermissionsUtil} */
this._permissionsUtil = new PermissionsUtil();
+ /* eslint-disable no-multi-spaces */
/** @type {import('backend').MessageHandlerMap} */
this._messageHandlers = new Map(/** @type {import('backend').MessageHandlerMapInit} */ ([
['requestBackendReadySignal', {async: false, contentScript: true, handler: this._onApiRequestBackendReadySignal.bind(this)}],
@@ -193,6 +194,7 @@ export class Backend {
['loadExtensionScripts', {async: true, contentScript: true, handler: this._onApiLoadExtensionScripts.bind(this)}],
['openCrossFramePort', {async: false, contentScript: true, handler: this._onApiOpenCrossFramePort.bind(this)}]
]));
+ /* eslint-enable no-multi-spaces */
/** @type {import('backend').MessageHandlerWithProgressMap} */
this._messageHandlersWithProgress = new Map(/** @type {import('backend').MessageHandlerWithProgressMapInit} */ ([
// Empty
@@ -201,10 +203,10 @@ export class Backend {
/** @type {Map<string, (params?: import('core').SerializableObject) => void>} */
this._commandHandlers = new Map(/** @type {[name: string, handler: (params?: import('core').SerializableObject) => void][]} */ ([
['toggleTextScanning', this._onCommandToggleTextScanning.bind(this)],
- ['openInfoPage', this._onCommandOpenInfoPage.bind(this)],
- ['openSettingsPage', this._onCommandOpenSettingsPage.bind(this)],
- ['openSearchPage', this._onCommandOpenSearchPage.bind(this)],
- ['openPopupWindow', this._onCommandOpenPopupWindow.bind(this)]
+ ['openInfoPage', this._onCommandOpenInfoPage.bind(this)],
+ ['openSettingsPage', this._onCommandOpenSettingsPage.bind(this)],
+ ['openSearchPage', this._onCommandOpenSearchPage.bind(this)],
+ ['openPopupWindow', this._onCommandOpenPopupWindow.bind(this)]
]));
}
@@ -805,7 +807,7 @@ export class Backend {
}
/** @type {import('api').Handler<import('api').GetOrCreateSearchPopupDetails, import('api').GetOrCreateSearchPopupResult>} */
- async _onApiGetOrCreateSearchPopup({focus=false, text}) {
+ async _onApiGetOrCreateSearchPopup({focus = false, text}) {
const {tab, created} = await this._getOrCreateSearchPopup();
if (focus === true || (focus === 'ifCreated' && created)) {
await this._focusTab(tab);
@@ -1979,7 +1981,7 @@ export class Backend {
* @param {?number} [timeout=null]
* @returns {Promise<void>}
*/
- _waitUntilTabFrameIsReady(tabId, frameId, timeout=null) {
+ _waitUntilTabFrameIsReady(tabId, frameId, timeout = null) {
return new Promise((resolve, reject) => {
/** @type {?import('core').Timeout} */
let timer = null;
diff --git a/ext/js/background/offscreen.js b/ext/js/background/offscreen.js
index 4b57514d..85b6847b 100644
--- a/ext/js/background/offscreen.js
+++ b/ext/js/background/offscreen.js
@@ -50,6 +50,7 @@ export class Offscreen {
richContentPasteTargetSelector: '#clipboard-rich-content-paste-target'
});
+ /* eslint-disable no-multi-spaces */
/** @type {import('offscreen').MessageHandlerMap} */
const messageHandlers = new Map([
['clipboardGetTextOffscreen', {async: true, handler: this._getTextHandler.bind(this)}],
@@ -65,6 +66,7 @@ export class Offscreen {
['getTermFrequenciesOffscreen', {async: true, handler: this._getTermFrequenciesHandler.bind(this)}],
['clearDatabaseCachesOffscreen', {async: false, handler: this._clearDatabaseCachesHandler.bind(this)}]
]);
+ /* eslint-enable no-multi-spaces */
/** @type {import('offscreen').MessageHandlerMap<string>} */
this._messageHandlers = messageHandlers;
diff --git a/ext/js/background/profile-conditions-util.js b/ext/js/background/profile-conditions-util.js
index ceade070..b1bbe1d5 100644
--- a/ext/js/background/profile-conditions-util.js
+++ b/ext/js/background/profile-conditions-util.js
@@ -34,11 +34,11 @@ export class ProfileConditionsUtil {
'popupLevel',
{
operators: new Map(/** @type {import('profile-conditions-util').OperatorMapArray} */ ([
- ['equal', this._createSchemaPopupLevelEqual.bind(this)],
- ['notEqual', this._createSchemaPopupLevelNotEqual.bind(this)],
- ['lessThan', this._createSchemaPopupLevelLessThan.bind(this)],
- ['greaterThan', this._createSchemaPopupLevelGreaterThan.bind(this)],
- ['lessThanOrEqual', this._createSchemaPopupLevelLessThanOrEqual.bind(this)],
+ ['equal', this._createSchemaPopupLevelEqual.bind(this)],
+ ['notEqual', this._createSchemaPopupLevelNotEqual.bind(this)],
+ ['lessThan', this._createSchemaPopupLevelLessThan.bind(this)],
+ ['greaterThan', this._createSchemaPopupLevelGreaterThan.bind(this)],
+ ['lessThanOrEqual', this._createSchemaPopupLevelLessThanOrEqual.bind(this)],
['greaterThanOrEqual', this._createSchemaPopupLevelGreaterThanOrEqual.bind(this)]
]))
}