From 86e28f5b00ddd59710f62832603ece02b2aa779a Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 22 Mar 2024 15:32:48 -0700 Subject: [PATCH] xo: Fix import/no-duplicates. Signed-off-by: Anders Kaseorg --- app/main/autoupdater.ts | 7 +++++-- app/main/badge-settings.ts | 3 +-- app/main/handle-external-link.ts | 14 +++++++------- app/main/index.ts | 3 ++- app/main/linuxupdater.ts | 3 +-- app/main/menu.ts | 8 ++++++-- app/main/request.ts | 3 +-- app/main/typed-ipc-main.ts | 8 +++----- app/renderer/js/components/context-menu.ts | 3 +-- app/renderer/js/components/functional-tab.ts | 6 ++---- app/renderer/js/components/server-tab.ts | 6 ++---- app/renderer/js/components/webview.ts | 3 +-- app/renderer/js/electron-bridge.ts | 9 +++++---- app/renderer/js/pages/preference/base-section.ts | 3 +-- app/renderer/js/pages/preference/nav.ts | 3 +-- app/renderer/js/tray.ts | 3 +-- app/renderer/js/typed-ipc-renderer.ts | 2 +- 17 files changed, 41 insertions(+), 46 deletions(-) diff --git a/app/main/autoupdater.ts b/app/main/autoupdater.ts index a9d438814..189b8807e 100644 --- a/app/main/autoupdater.ts +++ b/app/main/autoupdater.ts @@ -3,8 +3,11 @@ import {app, dialog, session} from "electron/main"; import process from "node:process"; import log from "electron-log/main"; -import type {UpdateDownloadedEvent, UpdateInfo} from "electron-updater"; -import {autoUpdater} from "electron-updater"; +import { + type UpdateDownloadedEvent, + type UpdateInfo, + autoUpdater, +} from "electron-updater"; import * as ConfigUtil from "../common/config-util.js"; diff --git a/app/main/badge-settings.ts b/app/main/badge-settings.ts index 8646a776c..1365de387 100644 --- a/app/main/badge-settings.ts +++ b/app/main/badge-settings.ts @@ -1,6 +1,5 @@ import {nativeImage} from "electron/common"; -import type {BrowserWindow} from "electron/main"; -import {app} from "electron/main"; +import {type BrowserWindow, app} from "electron/main"; import process from "node:process"; import * as ConfigUtil from "../common/config-util.js"; diff --git a/app/main/handle-external-link.ts b/app/main/handle-external-link.ts index 7297daa9c..c4a234fdd 100644 --- a/app/main/handle-external-link.ts +++ b/app/main/handle-external-link.ts @@ -1,11 +1,11 @@ -import type {Event} from "electron/common"; -import {shell} from "electron/common"; -import type { - HandlerDetails, - SaveDialogOptions, - WebContents, +import {type Event, shell} from "electron/common"; +import { + type HandlerDetails, + Notification, + type SaveDialogOptions, + type WebContents, + app, } from "electron/main"; -import {Notification, app} from "electron/main"; import fs from "node:fs"; import path from "node:path"; diff --git a/app/main/index.ts b/app/main/index.ts index 5b82f08dc..07aa81ba3 100644 --- a/app/main/index.ts +++ b/app/main/index.ts @@ -1,7 +1,8 @@ import {clipboard} from "electron/common"; -import type {IpcMainEvent, WebContents} from "electron/main"; import { BrowserWindow, + type IpcMainEvent, + type WebContents, app, dialog, powerMonitor, diff --git a/app/main/linuxupdater.ts b/app/main/linuxupdater.ts index 9d9a18b3b..bd6601e21 100644 --- a/app/main/linuxupdater.ts +++ b/app/main/linuxupdater.ts @@ -1,5 +1,4 @@ -import type {Session} from "electron/main"; -import {Notification, app} from "electron/main"; +import {Notification, type Session, app} from "electron/main"; import * as semver from "semver"; import {z} from "zod"; diff --git a/app/main/menu.ts b/app/main/menu.ts index de98c56f1..0b3237de0 100644 --- a/app/main/menu.ts +++ b/app/main/menu.ts @@ -1,6 +1,10 @@ import {shell} from "electron/common"; -import type {MenuItemConstructorOptions} from "electron/main"; -import {BrowserWindow, Menu, app} from "electron/main"; +import { + BrowserWindow, + Menu, + type MenuItemConstructorOptions, + app, +} from "electron/main"; import process from "node:process"; import AdmZip from "adm-zip"; diff --git a/app/main/request.ts b/app/main/request.ts index b247a2c1d..571eee688 100644 --- a/app/main/request.ts +++ b/app/main/request.ts @@ -1,5 +1,4 @@ -import type {Session} from "electron/main"; -import {app} from "electron/main"; +import {type Session, app} from "electron/main"; import fs from "node:fs"; import path from "node:path"; import {Readable} from "node:stream"; diff --git a/app/main/typed-ipc-main.ts b/app/main/typed-ipc-main.ts index 11eb1abfa..837459a70 100644 --- a/app/main/typed-ipc-main.ts +++ b/app/main/typed-ipc-main.ts @@ -1,9 +1,7 @@ -import type { - IpcMainEvent, - IpcMainInvokeEvent, - WebContents, -} from "electron/main"; import { + type IpcMainEvent, + type IpcMainInvokeEvent, + type WebContents, ipcMain as untypedIpcMain, // eslint-disable-line no-restricted-imports } from "electron/main"; diff --git a/app/renderer/js/components/context-menu.ts b/app/renderer/js/components/context-menu.ts index e82cf85ea..f274c291b 100644 --- a/app/renderer/js/components/context-menu.ts +++ b/app/renderer/js/components/context-menu.ts @@ -1,5 +1,4 @@ -import type {Event} from "electron/common"; -import {clipboard} from "electron/common"; +import {type Event, clipboard} from "electron/common"; import type {WebContents} from "electron/main"; import type { ContextMenuParams, diff --git a/app/renderer/js/components/functional-tab.ts b/app/renderer/js/components/functional-tab.ts index e0f9865f0..8792ee387 100644 --- a/app/renderer/js/components/functional-tab.ts +++ b/app/renderer/js/components/functional-tab.ts @@ -1,9 +1,7 @@ -import type {Html} from "../../../common/html.js"; -import {html} from "../../../common/html.js"; +import {type Html, html} from "../../../common/html.js"; import {generateNodeFromHtml} from "./base.js"; -import type {TabProps} from "./tab.js"; -import Tab from "./tab.js"; +import Tab, {type TabProps} from "./tab.js"; export type FunctionalTabProps = { $view: Element; diff --git a/app/renderer/js/components/server-tab.ts b/app/renderer/js/components/server-tab.ts index 7f9ec5c9b..915762f2d 100644 --- a/app/renderer/js/components/server-tab.ts +++ b/app/renderer/js/components/server-tab.ts @@ -1,12 +1,10 @@ import process from "node:process"; -import type {Html} from "../../../common/html.js"; -import {html} from "../../../common/html.js"; +import {type Html, html} from "../../../common/html.js"; import {ipcRenderer} from "../typed-ipc-renderer.js"; import {generateNodeFromHtml} from "./base.js"; -import type {TabProps} from "./tab.js"; -import Tab from "./tab.js"; +import Tab, {type TabProps} from "./tab.js"; import type WebView from "./webview.js"; export type ServerTabProps = { diff --git a/app/renderer/js/components/webview.ts b/app/renderer/js/components/webview.ts index 02697ffd5..d43d481ae 100644 --- a/app/renderer/js/components/webview.ts +++ b/app/renderer/js/components/webview.ts @@ -6,8 +6,7 @@ import * as remote from "@electron/remote"; import {app, dialog} from "@electron/remote"; import * as ConfigUtil from "../../../common/config-util.js"; -import type {Html} from "../../../common/html.js"; -import {html} from "../../../common/html.js"; +import {type Html, html} from "../../../common/html.js"; import type {RendererMessage} from "../../../common/typed-ipc.js"; import type {TabRole} from "../../../common/types.js"; import preloadCss from "../../css/preload.css?raw"; diff --git a/app/renderer/js/electron-bridge.ts b/app/renderer/js/electron-bridge.ts index 881af1d22..98f18d1c9 100644 --- a/app/renderer/js/electron-bridge.ts +++ b/app/renderer/js/electron-bridge.ts @@ -1,9 +1,10 @@ import {EventEmitter} from "node:events"; -import type {ClipboardDecrypter} from "./clipboard-decrypter.js"; -import {ClipboardDecrypterImpl} from "./clipboard-decrypter.js"; -import type {NotificationData} from "./notification/index.js"; -import {newNotification} from "./notification/index.js"; +import { + type ClipboardDecrypter, + ClipboardDecrypterImpl, +} from "./clipboard-decrypter.js"; +import {type NotificationData, newNotification} from "./notification/index.js"; import {ipcRenderer} from "./typed-ipc-renderer.js"; type ListenerType = (...args: any[]) => void; diff --git a/app/renderer/js/pages/preference/base-section.ts b/app/renderer/js/pages/preference/base-section.ts index 35dc0d653..eac484c44 100644 --- a/app/renderer/js/pages/preference/base-section.ts +++ b/app/renderer/js/pages/preference/base-section.ts @@ -1,5 +1,4 @@ -import type {Html} from "../../../../common/html.js"; -import {html} from "../../../../common/html.js"; +import {type Html, html} from "../../../../common/html.js"; import {generateNodeFromHtml} from "../../components/base.js"; import {ipcRenderer} from "../../typed-ipc-renderer.js"; diff --git a/app/renderer/js/pages/preference/nav.ts b/app/renderer/js/pages/preference/nav.ts index cc4a30f73..fc144de11 100644 --- a/app/renderer/js/pages/preference/nav.ts +++ b/app/renderer/js/pages/preference/nav.ts @@ -1,5 +1,4 @@ -import type {Html} from "../../../../common/html.js"; -import {html} from "../../../../common/html.js"; +import {type Html, html} from "../../../../common/html.js"; import * as t from "../../../../common/translation-util.js"; import type {NavItem} from "../../../../common/types.js"; import {generateNodeFromHtml} from "../../components/base.js"; diff --git a/app/renderer/js/tray.ts b/app/renderer/js/tray.ts index 8783e70e3..ab545134c 100644 --- a/app/renderer/js/tray.ts +++ b/app/renderer/js/tray.ts @@ -1,5 +1,4 @@ -import type {NativeImage} from "electron/common"; -import {nativeImage} from "electron/common"; +import {type NativeImage, nativeImage} from "electron/common"; import type {Tray as ElectronTray} from "electron/main"; import path from "node:path"; import process from "node:process"; diff --git a/app/renderer/js/typed-ipc-renderer.ts b/app/renderer/js/typed-ipc-renderer.ts index 858773749..043998c34 100644 --- a/app/renderer/js/typed-ipc-renderer.ts +++ b/app/renderer/js/typed-ipc-renderer.ts @@ -1,5 +1,5 @@ -import type {IpcRendererEvent} from "electron/renderer"; import { + type IpcRendererEvent, ipcRenderer as untypedIpcRenderer, // eslint-disable-line no-restricted-imports } from "electron/renderer";