diff --git a/.editorconfig b/.editorconfig index 6ec5bf4d3..db6d80c2d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,6 +6,6 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[{*.css,*.html,*.js,*.json,*.ts}] +[{*.cjs,*.css,*.html,*.js,*.json,*.ts}] indent_style = space indent_size = 2 diff --git a/app/common/config-util.ts b/app/common/config-util.ts index dece0d3e5..9c7ae37c0 100644 --- a/app/common/config-util.ts +++ b/app/common/config-util.ts @@ -7,9 +7,9 @@ import {DataError} from "node-json-db/dist/lib/Errors"; import type {z} from "zod"; import {app, dialog} from "zulip:remote"; -import {configSchemata} from "./config-schemata.js"; -import * as EnterpriseUtil from "./enterprise-util.js"; -import Logger from "./logger-util.js"; +import {configSchemata} from "./config-schemata.ts"; +import * as EnterpriseUtil from "./enterprise-util.ts"; +import Logger from "./logger-util.ts"; export type Config = { [Key in keyof typeof configSchemata]: z.output<(typeof configSchemata)[Key]>; diff --git a/app/common/dnd-util.ts b/app/common/dnd-util.ts index ed86980f5..23fba097c 100644 --- a/app/common/dnd-util.ts +++ b/app/common/dnd-util.ts @@ -2,8 +2,8 @@ import process from "node:process"; import type {z} from "zod"; -import type {dndSettingsSchemata} from "./config-schemata.js"; -import * as ConfigUtil from "./config-util.js"; +import type {dndSettingsSchemata} from "./config-schemata.ts"; +import * as ConfigUtil from "./config-util.ts"; export type DndSettings = { [Key in keyof typeof dndSettingsSchemata]: z.output< diff --git a/app/common/enterprise-util.ts b/app/common/enterprise-util.ts index 81d543ab9..f1690c986 100644 --- a/app/common/enterprise-util.ts +++ b/app/common/enterprise-util.ts @@ -1,4 +1,3 @@ -import {app} from "electron/main"; import fs from "node:fs"; import path from "node:path"; import process from "node:process"; @@ -6,8 +5,8 @@ import process from "node:process"; import {z} from "zod"; import {dialog} from "zulip:remote"; -import {enterpriseConfigSchemata} from "./config-schemata.js"; -import Logger from "./logger-util.js"; +import {enterpriseConfigSchemata} from "./config-schemata.ts"; +import Logger from "./logger-util.ts"; type EnterpriseConfig = { [Key in keyof typeof enterpriseConfigSchemata]: z.output< @@ -48,11 +47,6 @@ function reloadDatabase(): void { ); logger.log("Error while JSON parsing global_config.json: "); logger.log(error); - // This function is called multiple times throughout the - // codebase, making the above dialog.showErrorBox appear - // multiple times and then leading to a non-working app. - // It might be better to quit the app instead. - app.quit(); } } else { configFile = false; diff --git a/app/common/link-util.ts b/app/common/link-util.ts index bfd2157fa..43ab0de6a 100644 --- a/app/common/link-util.ts +++ b/app/common/link-util.ts @@ -3,7 +3,7 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; -import {html} from "./html.js"; +import {html} from "./html.ts"; export async function openBrowser(url: URL): Promise { if (["http:", "https:", "mailto:"].includes(url.protocol)) { diff --git a/app/common/logger-util.ts b/app/common/logger-util.ts index 6ce10c788..20818e3dd 100644 --- a/app/common/logger-util.ts +++ b/app/common/logger-util.ts @@ -5,7 +5,7 @@ import process from "node:process"; import {app} from "zulip:remote"; -import {initSetUp} from "./default-util.js"; +import {initSetUp} from "./default-util.ts"; type LoggerOptions = { file?: string; diff --git a/app/common/translation-util.ts b/app/common/translation-util.ts index 2bde7e51a..71feb6724 100644 --- a/app/common/translation-util.ts +++ b/app/common/translation-util.ts @@ -2,8 +2,8 @@ import path from "node:path"; import i18n from "i18n"; -import * as ConfigUtil from "./config-util.js"; -import {publicPath} from "./paths.js"; +import * as ConfigUtil from "./config-util.ts"; +import {publicPath} from "./paths.ts"; i18n.configure({ directory: path.join(publicPath, "translations/"), diff --git a/app/common/typed-ipc.ts b/app/common/typed-ipc.ts index 269f42984..ca10625a7 100644 --- a/app/common/typed-ipc.ts +++ b/app/common/typed-ipc.ts @@ -1,5 +1,5 @@ -import type {DndSettings} from "./dnd-util.js"; -import type {MenuProperties, ServerConfig} from "./types.js"; +import type {DndSettings} from "./dnd-util.ts"; +import type {MenuProperties, ServerConfig} from "./types.ts"; export type MainMessage = { "clear-app-settings": () => void; diff --git a/app/main/autoupdater.ts b/app/main/autoupdater.ts index 89687d197..29124648c 100644 --- a/app/main/autoupdater.ts +++ b/app/main/autoupdater.ts @@ -9,10 +9,10 @@ import { autoUpdater, } from "electron-updater"; -import * as ConfigUtil from "../common/config-util.js"; -import * as t from "../common/translation-util.js"; +import * as ConfigUtil from "../common/config-util.ts"; +import * as t from "../common/translation-util.ts"; -import {linuxUpdateNotification} from "./linuxupdater.js"; // Required only in case of linux +import {linuxUpdateNotification} from "./linuxupdater.ts"; // Required only in case of linux let quitting = false; diff --git a/app/main/badge-settings.ts b/app/main/badge-settings.ts index 1365de387..cfa877ce8 100644 --- a/app/main/badge-settings.ts +++ b/app/main/badge-settings.ts @@ -2,9 +2,9 @@ import {nativeImage} from "electron/common"; import {type BrowserWindow, app} from "electron/main"; import process from "node:process"; -import * as ConfigUtil from "../common/config-util.js"; +import * as ConfigUtil from "../common/config-util.ts"; -import {send} from "./typed-ipc-main.js"; +import {send} from "./typed-ipc-main.ts"; function showBadgeCount(messageCount: number, mainWindow: BrowserWindow): void { if (process.platform === "win32") { diff --git a/app/main/handle-external-link.ts b/app/main/handle-external-link.ts index c4a234fdd..d44dcbc82 100644 --- a/app/main/handle-external-link.ts +++ b/app/main/handle-external-link.ts @@ -9,10 +9,10 @@ import { import fs from "node:fs"; import path from "node:path"; -import * as ConfigUtil from "../common/config-util.js"; -import * as LinkUtil from "../common/link-util.js"; +import * as ConfigUtil from "../common/config-util.ts"; +import * as LinkUtil from "../common/link-util.ts"; -import {send} from "./typed-ipc-main.js"; +import {send} from "./typed-ipc-main.ts"; function isUploadsUrl(server: string, url: URL): boolean { return url.origin === server && url.pathname.startsWith("/user_uploads/"); diff --git a/app/main/index.ts b/app/main/index.ts index e04c59936..26cbe6913 100644 --- a/app/main/index.ts +++ b/app/main/index.ts @@ -17,20 +17,20 @@ import process from "node:process"; import * as remoteMain from "@electron/remote/main"; import windowStateKeeper from "electron-window-state"; -import * as ConfigUtil from "../common/config-util.js"; -import {bundlePath, bundleUrl, publicPath} from "../common/paths.js"; -import * as t from "../common/translation-util.js"; -import type {RendererMessage} from "../common/typed-ipc.js"; -import type {MenuProperties} from "../common/types.js"; - -import {appUpdater, shouldQuitForUpdate} from "./autoupdater.js"; -import * as BadgeSettings from "./badge-settings.js"; -import handleExternalLink from "./handle-external-link.js"; -import * as AppMenu from "./menu.js"; -import {_getServerSettings, _isOnline, _saveServerIcon} from "./request.js"; -import {sentryInit} from "./sentry.js"; -import {setAutoLaunch} from "./startup.js"; -import {ipcMain, send} from "./typed-ipc-main.js"; +import * as ConfigUtil from "../common/config-util.ts"; +import {bundlePath, bundleUrl, publicPath} from "../common/paths.ts"; +import * as t from "../common/translation-util.ts"; +import type {RendererMessage} from "../common/typed-ipc.ts"; +import type {MenuProperties} from "../common/types.ts"; + +import {appUpdater, shouldQuitForUpdate} from "./autoupdater.ts"; +import * as BadgeSettings from "./badge-settings.ts"; +import handleExternalLink from "./handle-external-link.ts"; +import * as AppMenu from "./menu.ts"; +import {_getServerSettings, _isOnline, _saveServerIcon} from "./request.ts"; +import {sentryInit} from "./sentry.ts"; +import {setAutoLaunch} from "./startup.ts"; +import {ipcMain, send} from "./typed-ipc-main.ts"; import "gatemaker/electron-setup"; // eslint-disable-line import/no-unassigned-import diff --git a/app/main/linux-update-util.ts b/app/main/linux-update-util.ts index 8414fbf94..fec2dfb0c 100644 --- a/app/main/linux-update-util.ts +++ b/app/main/linux-update-util.ts @@ -5,8 +5,8 @@ import path from "node:path"; import {JsonDB} from "node-json-db"; import {DataError} from "node-json-db/dist/lib/Errors"; -import Logger from "../common/logger-util.js"; -import * as t from "../common/translation-util.js"; +import Logger from "../common/logger-util.ts"; +import * as t from "../common/translation-util.ts"; const logger = new Logger({ file: "linux-update-util.log", diff --git a/app/main/linuxupdater.ts b/app/main/linuxupdater.ts index bd6601e21..955aef8f2 100644 --- a/app/main/linuxupdater.ts +++ b/app/main/linuxupdater.ts @@ -3,10 +3,10 @@ import {Notification, type Session, app} from "electron/main"; import * as semver from "semver"; import {z} from "zod"; -import * as ConfigUtil from "../common/config-util.js"; -import Logger from "../common/logger-util.js"; +import * as ConfigUtil from "../common/config-util.ts"; +import Logger from "../common/logger-util.ts"; -import * as LinuxUpdateUtil from "./linux-update-util.js"; +import * as LinuxUpdateUtil from "./linux-update-util.ts"; const logger = new Logger({ file: "linux-update-util.log", diff --git a/app/main/menu.ts b/app/main/menu.ts index b8b427ad3..ae1873895 100644 --- a/app/main/menu.ts +++ b/app/main/menu.ts @@ -9,14 +9,14 @@ import process from "node:process"; import AdmZip from "adm-zip"; -import * as ConfigUtil from "../common/config-util.js"; -import * as DNDUtil from "../common/dnd-util.js"; -import * as t from "../common/translation-util.js"; -import type {RendererMessage} from "../common/typed-ipc.js"; -import type {MenuProperties, TabData} from "../common/types.js"; +import * as ConfigUtil from "../common/config-util.ts"; +import * as DNDUtil from "../common/dnd-util.ts"; +import * as t from "../common/translation-util.ts"; +import type {RendererMessage} from "../common/typed-ipc.ts"; +import type {MenuProperties, TabData} from "../common/types.ts"; -import {appUpdater} from "./autoupdater.js"; -import {send} from "./typed-ipc-main.js"; +import {appUpdater} from "./autoupdater.ts"; +import {send} from "./typed-ipc-main.ts"; const appName = app.name; diff --git a/app/main/request.ts b/app/main/request.ts index 9042f09e2..33c992179 100644 --- a/app/main/request.ts +++ b/app/main/request.ts @@ -8,9 +8,9 @@ import type {ReadableStream} from "node:stream/web"; import * as Sentry from "@sentry/electron/main"; import {z} from "zod"; -import Logger from "../common/logger-util.js"; -import * as Messages from "../common/messages.js"; -import type {ServerConfig} from "../common/types.js"; +import Logger from "../common/logger-util.ts"; +import * as Messages from "../common/messages.ts"; +import type {ServerConfig} from "../common/types.ts"; /* Request: domain-util */ diff --git a/app/main/sentry.ts b/app/main/sentry.ts index fea458805..523b3d3e2 100644 --- a/app/main/sentry.ts +++ b/app/main/sentry.ts @@ -2,7 +2,7 @@ import {app} from "electron/main"; import * as Sentry from "@sentry/electron/main"; -import {getConfigItem} from "../common/config-util.js"; +import {getConfigItem} from "../common/config-util.ts"; export const sentryInit = (): void => { Sentry.init({ diff --git a/app/main/startup.ts b/app/main/startup.ts index 8e0db17ed..226feb1cb 100644 --- a/app/main/startup.ts +++ b/app/main/startup.ts @@ -3,7 +3,7 @@ import process from "node:process"; import AutoLaunch from "auto-launch"; -import * as ConfigUtil from "../common/config-util.js"; +import * as ConfigUtil from "../common/config-util.ts"; export const setAutoLaunch = async ( AutoLaunchValue: boolean, diff --git a/app/renderer/js/clipboard-decrypter.ts b/app/renderer/js/clipboard-decrypter.ts index aa7766636..e98813d5f 100644 --- a/app/renderer/js/clipboard-decrypter.ts +++ b/app/renderer/js/clipboard-decrypter.ts @@ -1,4 +1,4 @@ -import {ipcRenderer} from "./typed-ipc-renderer.js"; +import {ipcRenderer} from "./typed-ipc-renderer.ts"; // This helper is exposed via electron_bridge for use in the social // login flow. diff --git a/app/renderer/js/components/base.ts b/app/renderer/js/components/base.ts index baf066cac..8078df7cc 100644 --- a/app/renderer/js/components/base.ts +++ b/app/renderer/js/components/base.ts @@ -1,4 +1,4 @@ -import type {Html} from "../../../common/html.js"; +import type {Html} from "../../../common/html.ts"; export function generateNodeFromHtml(html: Html): Element { const wrapper = document.createElement("div"); diff --git a/app/renderer/js/components/context-menu.ts b/app/renderer/js/components/context-menu.ts index 0fd9f85b3..369f464a0 100644 --- a/app/renderer/js/components/context-menu.ts +++ b/app/renderer/js/components/context-menu.ts @@ -8,7 +8,7 @@ import process from "node:process"; import {Menu} from "@electron/remote"; -import * as t from "../../../common/translation-util.js"; +import * as t from "../../../common/translation-util.ts"; export const contextMenu = ( webContents: WebContents, diff --git a/app/renderer/js/components/functional-tab.ts b/app/renderer/js/components/functional-tab.ts index e3da71cd6..72614deb2 100644 --- a/app/renderer/js/components/functional-tab.ts +++ b/app/renderer/js/components/functional-tab.ts @@ -1,8 +1,8 @@ -import {type Html, html} from "../../../common/html.js"; -import type {TabPage} from "../../../common/types.js"; +import {type Html, html} from "../../../common/html.ts"; +import type {TabPage} from "../../../common/types.ts"; -import {generateNodeFromHtml} from "./base.js"; -import Tab, {type TabProperties} from "./tab.js"; +import {generateNodeFromHtml} from "./base.ts"; +import Tab, {type TabProperties} from "./tab.ts"; export type FunctionalTabProperties = { $view: Element; diff --git a/app/renderer/js/components/server-tab.ts b/app/renderer/js/components/server-tab.ts index e3d79cf80..b03c02e64 100644 --- a/app/renderer/js/components/server-tab.ts +++ b/app/renderer/js/components/server-tab.ts @@ -1,11 +1,11 @@ import process from "node:process"; -import {type Html, html} from "../../../common/html.js"; -import {ipcRenderer} from "../typed-ipc-renderer.js"; +import {type Html, html} from "../../../common/html.ts"; +import {ipcRenderer} from "../typed-ipc-renderer.ts"; -import {generateNodeFromHtml} from "./base.js"; -import Tab, {type TabProperties} from "./tab.js"; -import type WebView from "./webview.js"; +import {generateNodeFromHtml} from "./base.ts"; +import Tab, {type TabProperties} from "./tab.ts"; +import type WebView from "./webview.ts"; export type ServerTabProperties = { webview: Promise; diff --git a/app/renderer/js/components/tab.ts b/app/renderer/js/components/tab.ts index 556061fa1..c4c949bc0 100644 --- a/app/renderer/js/components/tab.ts +++ b/app/renderer/js/components/tab.ts @@ -1,4 +1,4 @@ -import type {TabPage, TabRole} from "../../../common/types.js"; +import type {TabPage, TabRole} from "../../../common/types.ts"; export type TabProperties = { role: TabRole; diff --git a/app/renderer/js/components/webview.ts b/app/renderer/js/components/webview.ts index b6d656f8c..19c79b7aa 100644 --- a/app/renderer/js/components/webview.ts +++ b/app/renderer/js/components/webview.ts @@ -5,17 +5,17 @@ import process from "node:process"; import * as remote from "@electron/remote"; import {app, dialog} from "@electron/remote"; -import * as ConfigUtil from "../../../common/config-util.js"; -import {type Html, html} from "../../../common/html.js"; -import * as t from "../../../common/translation-util.js"; -import type {RendererMessage} from "../../../common/typed-ipc.js"; -import type {TabRole} from "../../../common/types.js"; +import * as ConfigUtil from "../../../common/config-util.ts"; +import {type Html, html} from "../../../common/html.ts"; +import * as t from "../../../common/translation-util.ts"; +import type {RendererMessage} from "../../../common/typed-ipc.ts"; +import type {TabRole} from "../../../common/types.ts"; import preloadCss from "../../css/preload.css?raw"; -import {ipcRenderer} from "../typed-ipc-renderer.js"; -import * as SystemUtil from "../utils/system-util.js"; +import {ipcRenderer} from "../typed-ipc-renderer.ts"; +import * as SystemUtil from "../utils/system-util.ts"; -import {generateNodeFromHtml} from "./base.js"; -import {contextMenu} from "./context-menu.js"; +import {generateNodeFromHtml} from "./base.ts"; +import {contextMenu} from "./context-menu.ts"; const shouldSilentWebview = ConfigUtil.getConfigItem("silent", false); diff --git a/app/renderer/js/electron-bridge.ts b/app/renderer/js/electron-bridge.ts index 76aac16ec..ff6738db7 100644 --- a/app/renderer/js/electron-bridge.ts +++ b/app/renderer/js/electron-bridge.ts @@ -3,9 +3,9 @@ import {EventEmitter} from "node:events"; import { type ClipboardDecrypter, ClipboardDecrypterImplementation, -} from "./clipboard-decrypter.js"; -import {type NotificationData, newNotification} from "./notification/index.js"; -import {ipcRenderer} from "./typed-ipc-renderer.js"; +} from "./clipboard-decrypter.ts"; +import {type NotificationData, newNotification} from "./notification/index.ts"; +import {ipcRenderer} from "./typed-ipc-renderer.ts"; type ListenerType = (...arguments_: any[]) => void; diff --git a/app/renderer/js/main.ts b/app/renderer/js/main.ts index 861074738..0836371e9 100644 --- a/app/renderer/js/main.ts +++ b/app/renderer/js/main.ts @@ -7,17 +7,17 @@ import {Menu, app, dialog, session} from "@electron/remote"; import * as remote from "@electron/remote"; import * as Sentry from "@sentry/electron/renderer"; -import type {Config} from "../../common/config-util.js"; -import * as ConfigUtil from "../../common/config-util.js"; -import * as DNDUtil from "../../common/dnd-util.js"; -import type {DndSettings} from "../../common/dnd-util.js"; -import * as EnterpriseUtil from "../../common/enterprise-util.js"; -import {html} from "../../common/html.js"; -import * as LinkUtil from "../../common/link-util.js"; -import Logger from "../../common/logger-util.js"; -import * as Messages from "../../common/messages.js"; -import {bundlePath, bundleUrl} from "../../common/paths.js"; -import * as t from "../../common/translation-util.js"; +import type {Config} from "../../common/config-util.ts"; +import * as ConfigUtil from "../../common/config-util.ts"; +import * as DNDUtil from "../../common/dnd-util.ts"; +import type {DndSettings} from "../../common/dnd-util.ts"; +import * as EnterpriseUtil from "../../common/enterprise-util.ts"; +import {html} from "../../common/html.ts"; +import * as LinkUtil from "../../common/link-util.ts"; +import Logger from "../../common/logger-util.ts"; +import * as Messages from "../../common/messages.ts"; +import {bundlePath, bundleUrl} from "../../common/paths.ts"; +import * as t from "../../common/translation-util.ts"; import type { NavigationItem, ServerConfig, @@ -26,15 +26,15 @@ import type { } from "../../common/types.js"; import defaultIcon from "../img/icon.png"; -import FunctionalTab from "./components/functional-tab.js"; -import ServerTab from "./components/server-tab.js"; -import WebView from "./components/webview.js"; -import {AboutView} from "./pages/about.js"; -import {PreferenceView} from "./pages/preference/preference.js"; -import {initializeTray} from "./tray.js"; -import {ipcRenderer} from "./typed-ipc-renderer.js"; -import * as DomainUtil from "./utils/domain-util.js"; -import ReconnectUtil from "./utils/reconnect-util.js"; +import FunctionalTab from "./components/functional-tab.ts"; +import ServerTab from "./components/server-tab.ts"; +import WebView from "./components/webview.ts"; +import {AboutView} from "./pages/about.ts"; +import {PreferenceView} from "./pages/preference/preference.ts"; +import {initializeTray} from "./tray.ts"; +import {ipcRenderer} from "./typed-ipc-renderer.ts"; +import * as DomainUtil from "./utils/domain-util.ts"; +import ReconnectUtil from "./utils/reconnect-util.ts"; Sentry.init({}); diff --git a/app/renderer/js/notification/index.ts b/app/renderer/js/notification/index.ts index 988ae4f50..e54bfd970 100644 --- a/app/renderer/js/notification/index.ts +++ b/app/renderer/js/notification/index.ts @@ -1,4 +1,4 @@ -import {ipcRenderer} from "../typed-ipc-renderer.js"; +import {ipcRenderer} from "../typed-ipc-renderer.ts"; export type NotificationData = { close: () => void; diff --git a/app/renderer/js/pages/about.ts b/app/renderer/js/pages/about.ts index 523048b27..0ee20530f 100644 --- a/app/renderer/js/pages/about.ts +++ b/app/renderer/js/pages/about.ts @@ -1,9 +1,9 @@ import {app} from "@electron/remote"; -import {Html, html} from "../../../common/html.js"; -import {bundleUrl} from "../../../common/paths.js"; -import * as t from "../../../common/translation-util.js"; -import {generateNodeFromHtml} from "../components/base.js"; +import {Html, html} from "../../../common/html.ts"; +import {bundleUrl} from "../../../common/paths.ts"; +import * as t from "../../../common/translation-util.ts"; +import {generateNodeFromHtml} from "../components/base.ts"; export class AboutView { static async create(): Promise { diff --git a/app/renderer/js/pages/network.ts b/app/renderer/js/pages/network.ts index 1aabab161..32d664ec8 100644 --- a/app/renderer/js/pages/network.ts +++ b/app/renderer/js/pages/network.ts @@ -1,4 +1,4 @@ -import {ipcRenderer} from "../typed-ipc-renderer.js"; +import {ipcRenderer} from "../typed-ipc-renderer.ts"; export function init( $reconnectButton: Element, diff --git a/app/renderer/js/pages/preference/base-section.ts b/app/renderer/js/pages/preference/base-section.ts index 684e30694..7bb954c65 100644 --- a/app/renderer/js/pages/preference/base-section.ts +++ b/app/renderer/js/pages/preference/base-section.ts @@ -1,6 +1,6 @@ -import {type Html, html} from "../../../../common/html.js"; -import {generateNodeFromHtml} from "../../components/base.js"; -import {ipcRenderer} from "../../typed-ipc-renderer.js"; +import {type Html, html} from "../../../../common/html.ts"; +import {generateNodeFromHtml} from "../../components/base.ts"; +import {ipcRenderer} from "../../typed-ipc-renderer.ts"; type BaseSectionProperties = { $element: HTMLElement; diff --git a/app/renderer/js/pages/preference/connected-org-section.ts b/app/renderer/js/pages/preference/connected-org-section.ts index a56c7de92..a6dd78038 100644 --- a/app/renderer/js/pages/preference/connected-org-section.ts +++ b/app/renderer/js/pages/preference/connected-org-section.ts @@ -1,11 +1,11 @@ -import {html} from "../../../../common/html.js"; -import * as t from "../../../../common/translation-util.js"; -import {ipcRenderer} from "../../typed-ipc-renderer.js"; -import * as DomainUtil from "../../utils/domain-util.js"; +import {html} from "../../../../common/html.ts"; +import * as t from "../../../../common/translation-util.ts"; +import {ipcRenderer} from "../../typed-ipc-renderer.ts"; +import * as DomainUtil from "../../utils/domain-util.ts"; -import {reloadApp} from "./base-section.js"; -import {initFindAccounts} from "./find-accounts.js"; -import {initServerInfoForm} from "./server-info-form.js"; +import {reloadApp} from "./base-section.ts"; +import {initFindAccounts} from "./find-accounts.ts"; +import {initServerInfoForm} from "./server-info-form.ts"; type ConnectedOrgSectionProperties = { $root: Element; diff --git a/app/renderer/js/pages/preference/find-accounts.ts b/app/renderer/js/pages/preference/find-accounts.ts index c72e90661..cf08e1f67 100644 --- a/app/renderer/js/pages/preference/find-accounts.ts +++ b/app/renderer/js/pages/preference/find-accounts.ts @@ -1,7 +1,7 @@ -import {html} from "../../../../common/html.js"; -import * as LinkUtil from "../../../../common/link-util.js"; -import * as t from "../../../../common/translation-util.js"; -import {generateNodeFromHtml} from "../../components/base.js"; +import {html} from "../../../../common/html.ts"; +import * as LinkUtil from "../../../../common/link-util.ts"; +import * as t from "../../../../common/translation-util.ts"; +import {generateNodeFromHtml} from "../../components/base.ts"; type FindAccountsProperties = { $root: Element; diff --git a/app/renderer/js/pages/preference/general-section.ts b/app/renderer/js/pages/preference/general-section.ts index df48a5ab3..d2f7b6963 100644 --- a/app/renderer/js/pages/preference/general-section.ts +++ b/app/renderer/js/pages/preference/general-section.ts @@ -9,13 +9,13 @@ import Tagify from "@yaireo/tagify"; import {z} from "zod"; import supportedLocales from "../../../../../public/translations/supported-locales.json"; -import * as ConfigUtil from "../../../../common/config-util.js"; -import * as EnterpriseUtil from "../../../../common/enterprise-util.js"; -import {html} from "../../../../common/html.js"; -import * as t from "../../../../common/translation-util.js"; -import {ipcRenderer} from "../../typed-ipc-renderer.js"; +import * as ConfigUtil from "../../../../common/config-util.ts"; +import * as EnterpriseUtil from "../../../../common/enterprise-util.ts"; +import {html} from "../../../../common/html.ts"; +import * as t from "../../../../common/translation-util.ts"; +import {ipcRenderer} from "../../typed-ipc-renderer.ts"; -import {generateSelectHtml, generateSettingOption} from "./base-section.js"; +import {generateSelectHtml, generateSettingOption} from "./base-section.ts"; const currentBrowserWindow = remote.getCurrentWindow(); diff --git a/app/renderer/js/pages/preference/nav.ts b/app/renderer/js/pages/preference/nav.ts index 2a4efeb7e..009810af5 100644 --- a/app/renderer/js/pages/preference/nav.ts +++ b/app/renderer/js/pages/preference/nav.ts @@ -1,7 +1,7 @@ -import {type Html, html} from "../../../../common/html.js"; -import * as t from "../../../../common/translation-util.js"; -import type {NavigationItem} from "../../../../common/types.js"; -import {generateNodeFromHtml} from "../../components/base.js"; +import {type Html, html} from "../../../../common/html.ts"; +import * as t from "../../../../common/translation-util.ts"; +import type {NavigationItem} from "../../../../common/types.ts"; +import {generateNodeFromHtml} from "../../components/base.ts"; type PreferenceNavigationProperties = { $root: Element; diff --git a/app/renderer/js/pages/preference/network-section.ts b/app/renderer/js/pages/preference/network-section.ts index fd870ed94..39213ccae 100644 --- a/app/renderer/js/pages/preference/network-section.ts +++ b/app/renderer/js/pages/preference/network-section.ts @@ -1,9 +1,9 @@ -import * as ConfigUtil from "../../../../common/config-util.js"; -import {html} from "../../../../common/html.js"; -import * as t from "../../../../common/translation-util.js"; -import {ipcRenderer} from "../../typed-ipc-renderer.js"; +import * as ConfigUtil from "../../../../common/config-util.ts"; +import {html} from "../../../../common/html.ts"; +import * as t from "../../../../common/translation-util.ts"; +import {ipcRenderer} from "../../typed-ipc-renderer.ts"; -import {generateSettingOption} from "./base-section.js"; +import {generateSettingOption} from "./base-section.ts"; type NetworkSectionProperties = { $root: Element; diff --git a/app/renderer/js/pages/preference/new-server-form.ts b/app/renderer/js/pages/preference/new-server-form.ts index 999c88006..148531d48 100644 --- a/app/renderer/js/pages/preference/new-server-form.ts +++ b/app/renderer/js/pages/preference/new-server-form.ts @@ -1,11 +1,11 @@ import {dialog} from "@electron/remote"; -import {html} from "../../../../common/html.js"; -import * as LinkUtil from "../../../../common/link-util.js"; -import * as t from "../../../../common/translation-util.js"; -import {generateNodeFromHtml} from "../../components/base.js"; -import {ipcRenderer} from "../../typed-ipc-renderer.js"; -import * as DomainUtil from "../../utils/domain-util.js"; +import {html} from "../../../../common/html.ts"; +import * as LinkUtil from "../../../../common/link-util.ts"; +import * as t from "../../../../common/translation-util.ts"; +import {generateNodeFromHtml} from "../../components/base.ts"; +import {ipcRenderer} from "../../typed-ipc-renderer.ts"; +import * as DomainUtil from "../../utils/domain-util.ts"; type NewServerFormProperties = { $root: Element; diff --git a/app/renderer/js/pages/preference/preference.ts b/app/renderer/js/pages/preference/preference.ts index 1c9d46e91..aa4e3ac43 100644 --- a/app/renderer/js/pages/preference/preference.ts +++ b/app/renderer/js/pages/preference/preference.ts @@ -1,17 +1,17 @@ import type {IpcRendererEvent} from "electron/renderer"; import process from "node:process"; -import type {DndSettings} from "../../../../common/dnd-util.js"; -import {bundleUrl} from "../../../../common/paths.js"; -import type {NavigationItem} from "../../../../common/types.js"; -import {ipcRenderer} from "../../typed-ipc-renderer.js"; - -import {initConnectedOrgSection} from "./connected-org-section.js"; -import {initGeneralSection} from "./general-section.js"; -import Nav from "./nav.js"; -import {initNetworkSection} from "./network-section.js"; -import {initServersSection} from "./servers-section.js"; -import {initShortcutsSection} from "./shortcuts-section.js"; +import type {DndSettings} from "../../../../common/dnd-util.ts"; +import {bundleUrl} from "../../../../common/paths.ts"; +import type {NavigationItem} from "../../../../common/types.ts"; +import {ipcRenderer} from "../../typed-ipc-renderer.ts"; + +import {initConnectedOrgSection} from "./connected-org-section.ts"; +import {initGeneralSection} from "./general-section.ts"; +import Nav from "./nav.ts"; +import {initNetworkSection} from "./network-section.ts"; +import {initServersSection} from "./servers-section.ts"; +import {initShortcutsSection} from "./shortcuts-section.ts"; export class PreferenceView { static async create(): Promise { diff --git a/app/renderer/js/pages/preference/server-info-form.ts b/app/renderer/js/pages/preference/server-info-form.ts index bdfb88e9a..8e440e18c 100644 --- a/app/renderer/js/pages/preference/server-info-form.ts +++ b/app/renderer/js/pages/preference/server-info-form.ts @@ -1,12 +1,12 @@ import {dialog} from "@electron/remote"; -import {html} from "../../../../common/html.js"; -import * as Messages from "../../../../common/messages.js"; -import * as t from "../../../../common/translation-util.js"; -import type {ServerConfig} from "../../../../common/types.js"; -import {generateNodeFromHtml} from "../../components/base.js"; -import {ipcRenderer} from "../../typed-ipc-renderer.js"; -import * as DomainUtil from "../../utils/domain-util.js"; +import {html} from "../../../../common/html.ts"; +import * as Messages from "../../../../common/messages.ts"; +import * as t from "../../../../common/translation-util.ts"; +import type {ServerConfig} from "../../../../common/types.ts"; +import {generateNodeFromHtml} from "../../components/base.ts"; +import {ipcRenderer} from "../../typed-ipc-renderer.ts"; +import * as DomainUtil from "../../utils/domain-util.ts"; type ServerInfoFormProperties = { $root: Element; diff --git a/app/renderer/js/pages/preference/servers-section.ts b/app/renderer/js/pages/preference/servers-section.ts index f2962e16e..a161fd53c 100644 --- a/app/renderer/js/pages/preference/servers-section.ts +++ b/app/renderer/js/pages/preference/servers-section.ts @@ -1,8 +1,8 @@ -import {html} from "../../../../common/html.js"; -import * as t from "../../../../common/translation-util.js"; +import {html} from "../../../../common/html.ts"; +import * as t from "../../../../common/translation-util.ts"; -import {reloadApp} from "./base-section.js"; -import {initNewServerForm} from "./new-server-form.js"; +import {reloadApp} from "./base-section.ts"; +import {initNewServerForm} from "./new-server-form.ts"; type ServersSectionProperties = { $root: Element; diff --git a/app/renderer/js/pages/preference/shortcuts-section.ts b/app/renderer/js/pages/preference/shortcuts-section.ts index fbb07afa8..fa0d8c1c4 100644 --- a/app/renderer/js/pages/preference/shortcuts-section.ts +++ b/app/renderer/js/pages/preference/shortcuts-section.ts @@ -1,8 +1,8 @@ import process from "node:process"; -import {html} from "../../../../common/html.js"; -import * as LinkUtil from "../../../../common/link-util.js"; -import * as t from "../../../../common/translation-util.js"; +import {html} from "../../../../common/html.ts"; +import * as LinkUtil from "../../../../common/link-util.ts"; +import * as t from "../../../../common/translation-util.ts"; type ShortcutsSectionProperties = { $root: Element; diff --git a/app/renderer/js/preload.ts b/app/renderer/js/preload.ts index 431d710c9..e8699413e 100644 --- a/app/renderer/js/preload.ts +++ b/app/renderer/js/preload.ts @@ -1,8 +1,8 @@ import {contextBridge} from "electron/renderer"; -import electron_bridge, {bridgeEvents} from "./electron-bridge.js"; -import * as NetworkError from "./pages/network.js"; -import {ipcRenderer} from "./typed-ipc-renderer.js"; +import electron_bridge, {bridgeEvents} from "./electron-bridge.ts"; +import * as NetworkError from "./pages/network.ts"; +import {ipcRenderer} from "./typed-ipc-renderer.ts"; contextBridge.exposeInMainWorld("electron_bridge", electron_bridge); diff --git a/app/renderer/js/tray.ts b/app/renderer/js/tray.ts index 289090aa4..356f11edd 100644 --- a/app/renderer/js/tray.ts +++ b/app/renderer/js/tray.ts @@ -5,12 +5,12 @@ import process from "node:process"; import {BrowserWindow, Menu, Tray} from "@electron/remote"; -import * as ConfigUtil from "../../common/config-util.js"; -import {publicPath} from "../../common/paths.js"; -import type {RendererMessage} from "../../common/typed-ipc.js"; +import * as ConfigUtil from "../../common/config-util.ts"; +import {publicPath} from "../../common/paths.ts"; +import type {RendererMessage} from "../../common/typed-ipc.ts"; -import type {ServerManagerView} from "./main.js"; -import {ipcRenderer} from "./typed-ipc-renderer.js"; +import type {ServerManagerView} from "./main.ts"; +import {ipcRenderer} from "./typed-ipc-renderer.ts"; let tray: ElectronTray | null = null; diff --git a/app/renderer/js/utils/domain-util.ts b/app/renderer/js/utils/domain-util.ts index 3a9aa4876..34dbf5ce2 100644 --- a/app/renderer/js/utils/domain-util.ts +++ b/app/renderer/js/utils/domain-util.ts @@ -7,13 +7,13 @@ import {JsonDB} from "node-json-db"; import {DataError} from "node-json-db/dist/lib/Errors"; import {z} from "zod"; -import * as EnterpriseUtil from "../../../common/enterprise-util.js"; -import Logger from "../../../common/logger-util.js"; -import * as Messages from "../../../common/messages.js"; -import * as t from "../../../common/translation-util.js"; -import type {ServerConfig} from "../../../common/types.js"; +import * as EnterpriseUtil from "../../../common/enterprise-util.ts"; +import Logger from "../../../common/logger-util.ts"; +import * as Messages from "../../../common/messages.ts"; +import * as t from "../../../common/translation-util.ts"; +import type {ServerConfig} from "../../../common/types.ts"; import defaultIcon from "../../img/icon.png"; -import {ipcRenderer} from "../typed-ipc-renderer.js"; +import {ipcRenderer} from "../typed-ipc-renderer.ts"; const logger = new Logger({ file: "domain-util.log", diff --git a/app/renderer/js/utils/reconnect-util.ts b/app/renderer/js/utils/reconnect-util.ts index 118449d46..8af7892ac 100644 --- a/app/renderer/js/utils/reconnect-util.ts +++ b/app/renderer/js/utils/reconnect-util.ts @@ -1,9 +1,9 @@ import * as backoff from "backoff"; -import {html} from "../../../common/html.js"; -import Logger from "../../../common/logger-util.js"; -import type WebView from "../components/webview.js"; -import {ipcRenderer} from "../typed-ipc-renderer.js"; +import {html} from "../../../common/html.ts"; +import Logger from "../../../common/logger-util.ts"; +import type WebView from "../components/webview.ts"; +import {ipcRenderer} from "../typed-ipc-renderer.ts"; const logger = new Logger({ file: "domain-util.log", diff --git a/app/renderer/js/utils/system-util.ts b/app/renderer/js/utils/system-util.ts index 63af7d050..972b8c992 100644 --- a/app/renderer/js/utils/system-util.ts +++ b/app/renderer/js/utils/system-util.ts @@ -1,4 +1,4 @@ -import {ipcRenderer} from "../typed-ipc-renderer.js"; +import {ipcRenderer} from "../typed-ipc-renderer.ts"; export const connectivityError: string[] = [ "ERR_INTERNET_DISCONNECTED", diff --git a/package-lock.json b/package-lock.json index 0ddd031a7..43e5864ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,6 +34,7 @@ "electron-updater": "^6.3.4", "electron-window-state": "^5.0.3", "escape-goat": "^4.0.0", + "eslint-import-resolver-typescript": "^3.10.1", "htmlhint": "^1.1.2", "i18n": "^0.15.1", "i18next-scanner": "^4.6.0", @@ -564,6 +565,40 @@ "node": ">= 10.0.0" } }, + "node_modules/@emnapi/core": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.3.tgz", + "integrity": "sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.0.2", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.3.tgz", + "integrity": "sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.0.2.tgz", + "integrity": "sha512-5n3nTJblwRi8LlXkJ9eBzu+kZR8Yxcc7ubakyQTFzPMtIhFpUBRbsnc2Dv88IZDIbCDlBiWrknhB4Lsz7mg6BA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", @@ -1509,6 +1544,19 @@ "make-plural": "^7.0.0" } }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.11.tgz", + "integrity": "sha512-9DPkXtvHydrcOsopiYpUgPHpmj0HWZKMUnL2dZqpvC42lsratuBG06V5ipyno0fUek5VlFsNQ+AcFATSrJXgMA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.4.3", + "@emnapi/runtime": "^1.4.3", + "@tybys/wasm-util": "^0.9.0" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -1547,6 +1595,16 @@ "node": ">= 8" } }, + "node_modules/@nolyfill/is-core-module": { + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", + "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.4.0" + } + }, "node_modules/@npmcli/fs": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.2.tgz", @@ -2781,6 +2839,17 @@ "node": ">= 10" } }, + "node_modules/@tybys/wasm-util": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.9.0.tgz", + "integrity": "sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@types/adm-zip": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@types/adm-zip/-/adm-zip-0.5.7.tgz", @@ -3293,6 +3362,275 @@ "dev": true, "license": "ISC" }, + "node_modules/@unrs/resolver-binding-android-arm-eabi": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.9.1.tgz", + "integrity": "sha512-dd7yIp1hfJFX9ZlVLQRrh/Re9WMUHHmF9hrKD1yIvxcyNr2BhQ3xc1upAVhy8NijadnCswAxWQu8MkkSMC1qXQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@unrs/resolver-binding-android-arm64": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.9.1.tgz", + "integrity": "sha512-EzUPcMFtDVlo5yrbzMqUsGq3HnLXw+3ZOhSd7CUaDmbTtnrzM+RO2ntw2dm2wjbbc5djWj3yX0wzbbg8pLhx8g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@unrs/resolver-binding-darwin-arm64": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.9.1.tgz", + "integrity": "sha512-nB+dna3q4kOleKFcSZJ/wDXIsAd1kpMO9XrVAt8tG3RDWJ6vi+Ic6bpz4cmg5tWNeCfHEY4KuqJCB+pKejPEmQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@unrs/resolver-binding-darwin-x64": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.9.1.tgz", + "integrity": "sha512-aKWHCrOGaCGwZcekf3TnczQoBxk5w//W3RZ4EQyhux6rKDwBPgDU9Y2yGigCV1Z+8DWqZgVGQi+hdpnlSy3a1w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@unrs/resolver-binding-freebsd-x64": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.9.1.tgz", + "integrity": "sha512-4dIEMXrXt0UqDVgrsUd1I+NoIzVQWXy/CNhgpfS75rOOMK/4Abn0Mx2M2gWH4Mk9+ds/ASAiCmqoUFynmMY5hA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@unrs/resolver-binding-linux-arm-gnueabihf": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.9.1.tgz", + "integrity": "sha512-vtvS13IXPs1eE8DuS/soiosqMBeyh50YLRZ+p7EaIKAPPeevRnA9G/wu/KbVt01ZD5qiGjxS+CGIdVC7I6gTOw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-arm-musleabihf": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.9.1.tgz", + "integrity": "sha512-BfdnN6aZ7NcX8djW8SR6GOJc+K+sFhWRF4vJueVE0vbUu5N1bLnBpxJg1TGlhSyo+ImC4SR0jcNiKN0jdoxt+A==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-arm64-gnu": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.9.1.tgz", + "integrity": "sha512-Jhge7lFtH0QqfRz2PyJjJXWENqywPteITd+nOS0L6AhbZli+UmEyGBd2Sstt1c+l9C+j/YvKTl9wJo9PPmsFNg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-arm64-musl": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.9.1.tgz", + "integrity": "sha512-ofdK/ow+ZSbSU0pRoB7uBaiRHeaAOYQFU5Spp87LdcPL/P1RhbCTMSIYVb61XWzsVEmYKjHFtoIE0wxP6AFvrA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-ppc64-gnu": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.9.1.tgz", + "integrity": "sha512-eC8SXVn8de67HacqU7PoGdHA+9tGbqfEdD05AEFRAB81ejeQtNi5Fx7lPcxpLH79DW0BnMAHau3hi4RVkHfSCw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-riscv64-gnu": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.9.1.tgz", + "integrity": "sha512-fIkwvAAQ41kfoGWfzeJ33iLGShl0JEDZHrMnwTHMErUcPkaaZRJYjQjsFhMl315NEQ4mmTlC+2nfK/J2IszDOw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-riscv64-musl": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.9.1.tgz", + "integrity": "sha512-RAAszxImSOFLk44aLwnSqpcOdce8sBcxASledSzuFAd8Q5ZhhVck472SisspnzHdc7THCvGXiUeZ2hOC7NUoBQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-s390x-gnu": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.9.1.tgz", + "integrity": "sha512-QoP9vkY+THuQdZi05bA6s6XwFd6HIz3qlx82v9bTOgxeqin/3C12Ye7f7EOD00RQ36OtOPWnhEMMm84sv7d1XQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-x64-gnu": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.9.1.tgz", + "integrity": "sha512-/p77cGN/h9zbsfCseAP5gY7tK+7+DdM8fkPfr9d1ye1fsF6bmtGbtZN6e/8j4jCZ9NEIBBkT0GhdgixSelTK9g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-x64-musl": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.9.1.tgz", + "integrity": "sha512-wInTqT3Bu9u50mDStEig1v8uxEL2Ht+K8pir/YhyyrM5ordJtxoqzsL1vR/CQzOJuDunUTrDkMM0apjW/d7/PA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-wasm32-wasi": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.9.1.tgz", + "integrity": "sha512-eNwqO5kUa+1k7yFIircwwiniKWA0UFHo2Cfm8LYgkh9km7uMad+0x7X7oXbQonJXlqfitBTSjhA0un+DsHIrhw==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^0.2.11" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@unrs/resolver-binding-win32-arm64-msvc": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.9.1.tgz", + "integrity": "sha512-Eaz1xMUnoa2mFqh20mPqSdbYl6crnk8HnIXDu6nsla9zpgZJZO8w3c1gvNN/4Eb0RXRq3K9OG6mu8vw14gIqiA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@unrs/resolver-binding-win32-ia32-msvc": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.9.1.tgz", + "integrity": "sha512-H/+d+5BGlnEQif0gnwWmYbYv7HJj563PUKJfn8PlmzF8UmF+8KxdvXdwCsoOqh4HHnENnoLrav9NYBrv76x1wQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@unrs/resolver-binding-win32-x64-msvc": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.9.1.tgz", + "integrity": "sha512-rS86wI4R6cknYM3is3grCb/laE8XBEbpWAMSIPjYfmYp75KL5dT87jXF2orDa4tQYg5aajP5G8Fgh34dRyR+Rw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@webassemblyjs/ast": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", @@ -3822,6 +4160,19 @@ "node": ">= 8" } }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/app-builder-bin": { "version": "5.0.0-alpha.10", "resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-5.0.0-alpha.10.tgz", @@ -6832,6 +7183,41 @@ "ms": "^2.1.1" } }, + "node_modules/eslint-import-resolver-typescript": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.10.1.tgz", + "integrity": "sha512-A1rHYb06zjMGAxdLSkN2fXPBwuSaQ0iO5M/hdyS0Ajj1VBaRp0sPD3dn1FhME3c/JluGFbwSxyCfqdSbtQLAHQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "@nolyfill/is-core-module": "1.0.39", + "debug": "^4.4.0", + "get-tsconfig": "^4.10.0", + "is-bun-module": "^2.0.0", + "stable-hash": "^0.0.5", + "tinyglobby": "^0.2.13", + "unrs-resolver": "^1.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-import-resolver-typescript" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*", + "eslint-plugin-import-x": "*" + }, + "peerDependenciesMeta": { + "eslint-plugin-import": { + "optional": true + }, + "eslint-plugin-import-x": { + "optional": true + } + } + }, "node_modules/eslint-import-resolver-webpack": { "version": "0.13.10", "resolved": "https://registry.npmjs.org/eslint-import-resolver-webpack/-/eslint-import-resolver-webpack-0.13.10.tgz", @@ -7886,6 +8272,21 @@ "pend": "~1.2.0" } }, + "node_modules/fdir": { + "version": "6.4.6", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.6.tgz", + "integrity": "sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, "node_modules/figures": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", @@ -9545,6 +9946,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-bun-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-2.0.0.tgz", + "integrity": "sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.7.1" + } + }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -10877,6 +11288,19 @@ "node": ">=8.6" } }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/mime": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", @@ -11151,6 +11575,22 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/napi-postinstall": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.2.4.tgz", + "integrity": "sha512-ZEzHJwBhZ8qQSbknHqYcdtQVr8zUgGyM/q6h6qAyhtyVMNrSgDhrC4disf03dYW0e+czXyLnZINnCTEkWy0eJg==", + "dev": true, + "license": "MIT", + "bin": { + "napi-postinstall": "lib/cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/napi-postinstall" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -11953,13 +12393,13 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "dev": true, "license": "MIT", "engines": { - "node": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" @@ -13614,6 +14054,13 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/stable-hash": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.5.tgz", + "integrity": "sha512-+L3ccpzibovGXFK+Ap/f8LOS0ahMrHTf3xu7mMLSpEGU0EO9ucaysSylKo9eRDFNhWve/y275iPmIZ4z39a9iA==", + "dev": true, + "license": "MIT" + }, "node_modules/stat-mode": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-1.0.0.tgz", @@ -14383,6 +14830,23 @@ "dev": true, "license": "MIT" }, + "node_modules/tinyglobby": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", + "integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.4.4", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, "node_modules/tmp": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", @@ -14717,6 +15181,41 @@ "node": ">= 4.0.0" } }, + "node_modules/unrs-resolver": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.9.1.tgz", + "integrity": "sha512-4AZVxP05JGN6DwqIkSP4VKLOcwQa5l37SWHF/ahcuqBMbfxbpN1L1QKafEhWCziHhzKex9H/AR09H0OuVyU+9g==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "napi-postinstall": "^0.2.2" + }, + "funding": { + "url": "https://opencollective.com/unrs-resolver" + }, + "optionalDependencies": { + "@unrs/resolver-binding-android-arm-eabi": "1.9.1", + "@unrs/resolver-binding-android-arm64": "1.9.1", + "@unrs/resolver-binding-darwin-arm64": "1.9.1", + "@unrs/resolver-binding-darwin-x64": "1.9.1", + "@unrs/resolver-binding-freebsd-x64": "1.9.1", + "@unrs/resolver-binding-linux-arm-gnueabihf": "1.9.1", + "@unrs/resolver-binding-linux-arm-musleabihf": "1.9.1", + "@unrs/resolver-binding-linux-arm64-gnu": "1.9.1", + "@unrs/resolver-binding-linux-arm64-musl": "1.9.1", + "@unrs/resolver-binding-linux-ppc64-gnu": "1.9.1", + "@unrs/resolver-binding-linux-riscv64-gnu": "1.9.1", + "@unrs/resolver-binding-linux-riscv64-musl": "1.9.1", + "@unrs/resolver-binding-linux-s390x-gnu": "1.9.1", + "@unrs/resolver-binding-linux-x64-gnu": "1.9.1", + "@unrs/resolver-binding-linux-x64-musl": "1.9.1", + "@unrs/resolver-binding-wasm32-wasi": "1.9.1", + "@unrs/resolver-binding-win32-arm64-msvc": "1.9.1", + "@unrs/resolver-binding-win32-ia32-msvc": "1.9.1", + "@unrs/resolver-binding-win32-x64-msvc": "1.9.1" + } + }, "node_modules/untildify": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/untildify/-/untildify-3.0.3.tgz", diff --git a/package.json b/package.json index e7b774734..9df753288 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "lint-css": "stylelint \"app/**/*.css\"", "lint-html": "htmlhint \"app/**/*.html\"", "lint-js": "xo", - "prettier-non-js": "prettier --check --log-level=warn . \"!**/*.{js,ts}\"", + "prettier-non-js": "prettier --check --log-level=warn . \"!**/*.{cjs,js,ts}\"", "test": "tsc && npm run lint-html && npm run lint-css && npm run lint-js && npm run prettier-non-js", "test-e2e": "vite build && tape \"tests/**/*.js\"", "pack": "vite build && electron-builder --dir", @@ -174,6 +174,7 @@ "electron-updater": "^6.3.4", "electron-window-state": "^5.0.3", "escape-goat": "^4.0.0", + "eslint-import-resolver-typescript": "^3.10.1", "htmlhint": "^1.1.2", "i18n": "^0.15.1", "i18next-scanner": "^4.6.0", @@ -196,142 +197,5 @@ "bracketSpacing": false, "singleQuote": false, "trailingComma": "all" - }, - "xo": { - "prettier": true, - "rules": { - "@typescript-eslint/no-dynamic-delete": "off", - "arrow-body-style": "error", - "import/no-restricted-paths": [ - "error", - { - "zones": [ - { - "target": "./app/common", - "from": "./app", - "except": [ - "./common" - ] - }, - { - "target": "./app/main", - "from": "./app", - "except": [ - "./common", - "./main" - ] - }, - { - "target": "./app/renderer", - "from": "./app", - "except": [ - "./common", - "./renderer", - "./resources" - ] - } - ] - } - ], - "import/order": [ - "error", - { - "alphabetize": { - "order": "asc" - }, - "newlines-between": "always" - } - ], - "import/unambiguous": "error", - "no-restricted-imports": [ - "error", - { - "paths": [ - { - "name": "@sentry/electron", - "message": "Use @sentry/electron/main, @sentry/electron/renderer, or @sentry/core." - }, - { - "name": "electron", - "message": "Use electron/main, electron/renderer, or electron/common." - }, - { - "name": "electron/main", - "importNames": [ - "ipcMain" - ], - "message": "Use typed-ipc-main." - }, - { - "name": "electron/renderer", - "importNames": [ - "ipcRenderer" - ], - "message": "Use typed-ipc-renderer." - }, - { - "name": "electron-log", - "message": "Use electron-log/main or electron-log/renderer." - } - ] - } - ], - "no-warning-comments": "off", - "sort-imports": [ - "error", - { - "ignoreDeclarationSort": true - } - ], - "strict": "error", - "unicorn/prefer-module": "off", - "unicorn/prefer-top-level-await": "off" - }, - "envs": [ - "node", - "browser" - ], - "overrides": [ - { - "files": [ - "**/*.ts" - ], - "rules": { - "@typescript-eslint/ban-types": "off", - "@typescript-eslint/consistent-type-imports": [ - "error", - { - "disallowTypeAnnotations": false - } - ], - "@typescript-eslint/no-unused-vars": [ - "error", - { - "argsIgnorePattern": "^_", - "caughtErrors": "all" - } - ], - "unicorn/no-await-expression-member": "off" - } - }, - { - "files": [ - "i18next-scanner.config.js", - "scripts/win-sign.js", - "tests/**/*.js" - ], - "parserOptions": { - "sourceType": "script" - } - }, - { - "files": [ - "**/*.d.ts" - ], - "rules": { - "import/unambiguous": "off" - } - } - ] } } diff --git a/tsconfig.json b/tsconfig.json index fb82846fc..5ff68edb3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,7 @@ "target": "esnext", "module": "esnext", "moduleResolution": "bundler", + "allowImportingTsExtensions": true, "esModuleInterop": true, "paths": { // https://github.com/getsentry/sentry-electron/issues/957 diff --git a/xo.config.cjs b/xo.config.cjs new file mode 100644 index 000000000..8050028a9 --- /dev/null +++ b/xo.config.cjs @@ -0,0 +1,175 @@ +"use strict"; + +const restrictedMainImports = [ + { + name: "@sentry/electron/main", + message: "Cannot use main-only APIs here.", + }, + { + name: "electron/main", + message: "Cannot use main-only APIs here.", + allowTypeImports: true, // https://github.com/zulip/zulip-desktop/issues/915 + }, + { + name: "electron-log/main", + message: "Cannot use main-only APIs here.", + }, +]; + +const restrictedRendererImports = [ + { + name: "@sentry/electron/renderer", + message: "Cannot use renderer-only APIs here.", + }, + { + name: "electron/renderer", + message: "Cannot use renderer-only APIs here.", + }, + { + name: "electron-log/renderer", + message: "Cannot use renderer-only APIs here.", + }, +]; + +module.exports = { + prettier: true, + settings: { + "import/resolver": "typescript", + n: { + typescriptExtensionMap: [], + }, + }, + rules: { + "@typescript-eslint/no-dynamic-delete": "off", + "arrow-body-style": "error", + "import/no-extraneous-dependencies": [ + "error", + {includeTypes: true, packageDir: __dirname}, + ], + "import/no-restricted-paths": [ + "error", + { + zones: [ + { + target: "./app/common", + from: "./app", + except: ["./common"], + }, + { + target: "./app/main", + from: "./app", + except: ["./common", "./main"], + }, + { + target: "./app/renderer", + from: "./app", + except: ["./common", "./renderer", "./resources"], + }, + ], + }, + ], + "import/order": [ + "error", + {alphabetize: {order: "asc"}, "newlines-between": "always"}, + ], + "import/unambiguous": "error", + "no-restricted-imports": [ + "error", + { + paths: [ + { + name: "@sentry/electron", + message: + "Use @sentry/electron/main, @sentry/electron/renderer, or @sentry/core.", + }, + { + name: "electron", + message: + "Use electron/main, electron/renderer, or electron/common.", + }, + { + name: "electron/main", + importNames: ["ipcMain"], + message: "Use typed-ipc-main.", + }, + { + name: "electron/renderer", + importNames: ["ipcRenderer"], + message: "Use typed-ipc-renderer.", + }, + { + name: "electron-log", + message: "Use electron-log/main or electron-log/renderer.", + }, + ], + }, + ], + "no-warning-comments": "off", + "sort-imports": ["error", {ignoreDeclarationSort: true}], + strict: "error", + "unicorn/prefer-module": "off", + "unicorn/prefer-top-level-await": "off", + }, + envs: ["node", "browser"], + overrides: [ + { + files: ["**/*.ts"], + rules: { + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/consistent-type-imports": [ + "error", + {disallowTypeAnnotations: false}, + ], + "@typescript-eslint/no-unused-vars": [ + "error", + {argsIgnorePattern: "^_", caughtErrors: "all"}, + ], + "unicorn/no-await-expression-member": "off", + }, + }, + { + files: [ + "**.cjs", + "i18next-scanner.config.js", + "scripts/win-sign.js", + "tests/**/*.js", + ], + parserOptions: { + sourceType: "script", + }, + }, + { + files: ["**/*.d.ts"], + rules: { + "import/unambiguous": "off", + }, + }, + { + files: ["app/common/**"], + rules: { + "@typescript-eslint/no-restricted-imports": [ + "error", + {paths: [...restrictedMainImports, ...restrictedRendererImports]}, + ], + }, + }, + { + files: ["app/main/**"], + rules: { + "@typescript-eslint/no-restricted-imports": [ + "error", + {paths: restrictedRendererImports}, + ], + }, + }, + { + files: ["app/renderer/**"], + rules: { + "@typescript-eslint/no-restricted-imports": [ + "error", + {paths: restrictedMainImports}, + ], + }, + }, + ], +};