From 2e7006ce24c42ec2b6642346d153429338e7334e Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 22 Dec 2019 10:01:24 +0900 Subject: npm run lint:fix --- src/background/infrastructures/ContentMessageClient.ts | 6 +++--- src/background/infrastructures/ContentMessageListener.ts | 8 ++++---- src/background/infrastructures/MemoryStorage.ts | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/background/infrastructures') diff --git a/src/background/infrastructures/ContentMessageClient.ts b/src/background/infrastructures/ContentMessageClient.ts index 4d2284c..b6c0c23 100644 --- a/src/background/infrastructures/ContentMessageClient.ts +++ b/src/background/infrastructures/ContentMessageClient.ts @@ -4,8 +4,8 @@ import * as messages from '../../shared/messages'; @injectable() export default class ContentMessageClient { async broadcastSettingsChanged(): Promise { - let tabs = await browser.tabs.query({}); - for (let tab of tabs) { + const tabs = await browser.tabs.query({}); + for (const tab of tabs) { if (!tab.id || tab.url && tab.url.startsWith('about:')) { continue; } @@ -16,7 +16,7 @@ export default class ContentMessageClient { } async getAddonEnabled(tabId: number): Promise { - let enabled = await browser.tabs.sendMessage(tabId, { + const enabled = await browser.tabs.sendMessage(tabId, { type: messages.ADDON_ENABLED_QUERY, }); return enabled as any as boolean; diff --git a/src/background/infrastructures/ContentMessageListener.ts b/src/background/infrastructures/ContentMessageListener.ts index f20340b..d063810 100644 --- a/src/background/infrastructures/ContentMessageListener.ts +++ b/src/background/infrastructures/ContentMessageListener.ts @@ -31,7 +31,7 @@ export default class ContentMessageListener { message: any, sender: browser.runtime.MessageSender, ) => { try { - let ret = this.onMessage(message, sender.tab as browser.tabs.Tab); + const ret = this.onMessage(message, sender.tab as browser.tabs.Tab); if (!(ret instanceof Promise)) { return {}; } @@ -94,7 +94,7 @@ export default class ContentMessageListener { } async onConsoleQueryCompletions(line: string): Promise { - let completions = await this.commandController.getCompletions(line); + const completions = await this.commandController.getCompletions(line); return Promise.resolve(completions); } @@ -140,7 +140,7 @@ export default class ContentMessageListener { } onConsoleFrameMessage(tabId: number, message: any): void { - let port = this.consolePorts[tabId]; + const port = this.consolePorts[tabId]; if (!port) { return; } @@ -153,7 +153,7 @@ export default class ContentMessageListener { } if (port.sender && port.sender.tab && port.sender.tab.id) { - let id = port.sender.tab.id; + const id = port.sender.tab.id; this.consolePorts[id] = port; } } diff --git a/src/background/infrastructures/MemoryStorage.ts b/src/background/infrastructures/MemoryStorage.ts index baf9ffa..af445a6 100644 --- a/src/background/infrastructures/MemoryStorage.ts +++ b/src/background/infrastructures/MemoryStorage.ts @@ -2,7 +2,7 @@ const db: {[key: string]: any} = {}; export default class MemoryStorage { set(name: string, value: any): void { - let data = JSON.stringify(value); + const data = JSON.stringify(value); if (typeof data === 'undefined') { throw new Error('value is not serializable'); } @@ -10,7 +10,7 @@ export default class MemoryStorage { } get(name: string): any { - let data = db[name]; + const data = db[name]; if (!data) { return undefined; } -- cgit v1.2.3