Skip to content

Commit 8050da1

Browse files
committed
Replace top-level require() with await import()
1 parent edb4009 commit 8050da1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/clipboard.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import type {
2222
let fswin: typeof import("fswin") | undefined;
2323

2424
if (process.platform === "win32") {
25-
// eslint-disable-next-line unicorn/prefer-module
26-
fswin = require("fswin");
25+
const { default: fswinModule } = await import("fswin");
26+
fswin = fswinModule;
2727
}
2828

2929
export type ClipboardType = "text" | "image" | "files";

src/main/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ if (process.platform === "darwin") {
8282
let clipboardEx: typeof import("electron-clipboard-ex") | undefined;
8383

8484
if (process.platform !== "linux") {
85-
// eslint-disable-next-line unicorn/prefer-module
86-
clipboardEx = require("electron-clipboard-ex");
85+
const { default: clipboardExModule } = await import("electron-clipboard-ex");
86+
clipboardEx = clipboardExModule;
8787
}
8888

8989
type ConfigType = {

0 commit comments

Comments
 (0)