Fix more linting issues.

This commit is contained in:
Bauke 2023-04-15 12:02:21 +02:00
parent a722421130
commit 861c340ec7
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 16 additions and 16 deletions

View File

@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/naming-convention */ /* eslint-disable @typescript-eslint/naming-convention */
import {type Manifest} from 'webextension-polyfill'; import {type Manifest} from "webextension-polyfill";
/** /**
* Creates the WebExtension manifest based on the browser target. * Creates the WebExtension manifest based on the browser target.
@ -11,26 +11,26 @@ import {type Manifest} from 'webextension-polyfill';
export function createManifest(browser: string): Manifest.WebExtensionManifest { export function createManifest(browser: string): Manifest.WebExtensionManifest {
const manifest: Manifest.WebExtensionManifest = { const manifest: Manifest.WebExtensionManifest = {
manifest_version: Number.NaN, manifest_version: Number.NaN,
name: 'Queue', name: "Queue",
version: '0.3.2', version: "0.3.2",
permissions: ['contextMenus', 'storage'], permissions: ["contextMenus", "storage"],
options_ui: { options_ui: {
page: 'options/index.html', page: "options/index.html",
open_in_tab: true, open_in_tab: true,
}, },
}; };
const icons: Manifest.IconPath = { const icons: Manifest.IconPath = {
128: 'queue.png', 128: "queue.png",
}; };
const action: Manifest.ActionManifest = { const action: Manifest.ActionManifest = {
default_icon: icons, default_icon: icons,
}; };
const backgroundScript = 'background/setup.js'; const backgroundScript = "background/setup.js";
if (browser === 'firefox') { if (browser === "firefox") {
manifest.manifest_version = 2; manifest.manifest_version = 2;
manifest.background = { manifest.background = {
scripts: [backgroundScript], scripts: [backgroundScript],
@ -38,23 +38,23 @@ export function createManifest(browser: string): Manifest.WebExtensionManifest {
manifest.browser_action = action; manifest.browser_action = action;
manifest.browser_specific_settings = { manifest.browser_specific_settings = {
gecko: { gecko: {
id: '{c3560e6b-00e5-4ab3-b89e-8a54ee5b2c9f}', id: "{c3560e6b-00e5-4ab3-b89e-8a54ee5b2c9f}",
strict_min_version: '102.0', strict_min_version: "102.0",
}, },
}; };
} else if (browser === 'chromium') { } else if (browser === "chromium") {
manifest.manifest_version = 3; manifest.manifest_version = 3;
manifest.action = action; manifest.action = action;
manifest.background = { manifest.background = {
service_worker: backgroundScript, service_worker: backgroundScript,
type: 'module', type: "module",
}; };
} else { } else {
throw new Error(`Unknown target browser: ${browser}`); throw new Error(`Unknown target browser: ${browser}`);
} }
if (Number.isNaN(manifest.manifest_version)) { if (Number.isNaN(manifest.manifest_version)) {
throw new TypeError('Manifest version is NaN'); throw new TypeError("Manifest version is NaN");
} }
return manifest; return manifest;

View File

@ -1,8 +1,8 @@
// Type definitions for third-party packages. // Type definitions for third-party packages.
declare module 'esbuild-copy-static-files' { declare module "esbuild-copy-static-files" {
import {type cpSync} from 'node:fs'; import {type cpSync} from "node:fs";
import {type Plugin} from 'esbuild'; import {type Plugin} from "esbuild";
type CopySyncParameters = Parameters<typeof cpSync>; type CopySyncParameters = Parameters<typeof cpSync>;