diff --git a/packages/wxt/e2e/utils.ts b/packages/wxt/e2e/utils.ts index 9d2394af..bcca1a26 100644 --- a/packages/wxt/e2e/utils.ts +++ b/packages/wxt/e2e/utils.ts @@ -189,9 +189,9 @@ export class TestProject { return fs.pathExists(this.resolvePath(...path)); } - async getOutputManifest( + getOutputManifest( path: string = '.output/chrome-mv3/manifest.json', ): Promise { - return await fs.readJson(this.resolvePath(path)); + return fs.readJson(this.resolvePath(path)); } } diff --git a/packages/wxt/src/core/builders/vite/index.ts b/packages/wxt/src/core/builders/vite/index.ts index c798749d..d88e5b11 100644 --- a/packages/wxt/src/core/builders/vite/index.ts +++ b/packages/wxt/src/core/builders/vite/index.ts @@ -453,7 +453,7 @@ async function moveHtmlFiles( ); // TODO: Optimize and only delete old path directories - removeEmptyDirs(config.outDir); + await removeEmptyDirs(config.outDir); return movedChunks; } diff --git a/packages/wxt/src/core/builders/vite/plugins/download.ts b/packages/wxt/src/core/builders/vite/plugins/download.ts index 28ef30ac..68460f34 100644 --- a/packages/wxt/src/core/builders/vite/plugins/download.ts +++ b/packages/wxt/src/core/builders/vite/plugins/download.ts @@ -15,12 +15,12 @@ export function download(config: ResolvedConfig): Plugin { resolveId(id) { if (id.startsWith('url:')) return '\0' + id; }, - async load(id) { + load(id) { if (!id.startsWith('\0url:')) return; // Load file from network or cache const url = id.replace('\0url:', ''); - return await fetchCached(url, config); + return fetchCached(url, config); }, }; } diff --git a/packages/wxt/src/core/runners/web-ext.ts b/packages/wxt/src/core/runners/web-ext.ts index 1d45fea5..46309142 100644 --- a/packages/wxt/src/core/runners/web-ext.ts +++ b/packages/wxt/src/core/runners/web-ext.ts @@ -88,7 +88,7 @@ export function createWebExtRunner(): ExtensionRunner { }, async closeBrowser() { - return await runner?.exit(); + await runner?.exit(); }, }; } diff --git a/packages/wxt/src/core/utils/building/find-entrypoints.ts b/packages/wxt/src/core/utils/building/find-entrypoints.ts index 06e49818..cb05f5c8 100644 --- a/packages/wxt/src/core/utils/building/find-entrypoints.ts +++ b/packages/wxt/src/core/utils/building/find-entrypoints.ts @@ -184,8 +184,7 @@ async function importEntrypoints(infos: EntrypointInfo[]) { await Promise.all([ // HTML ...htmlInfos.map(async (info) => { - const res = await importHtmlEntrypoint(info); - resMap[info.inputPath] = res; + resMap[info.inputPath] = await importHtmlEntrypoint(info); }), // JS (async () => { diff --git a/packages/wxt/src/core/utils/building/internal-build.ts b/packages/wxt/src/core/utils/building/internal-build.ts index da551d8a..4e718bd6 100644 --- a/packages/wxt/src/core/utils/building/internal-build.ts +++ b/packages/wxt/src/core/utils/building/internal-build.ts @@ -87,7 +87,7 @@ export async function internalBuild(): Promise { } else { wxt.logger.info(`Opening ${pc.yellow(statsPath)} in browser...`); const { default: open } = await import('open'); - open(wxt.config.analysis.outputFile); + await open(wxt.config.analysis.outputFile); } } } diff --git a/packages/wxt/src/core/utils/network.ts b/packages/wxt/src/core/utils/network.ts index 57a7918b..fbeef4ac 100644 --- a/packages/wxt/src/core/utils/network.ts +++ b/packages/wxt/src/core/utils/network.ts @@ -4,13 +4,7 @@ import { withTimeout } from './time'; function isOffline(): Promise { const isOffline = new Promise((res) => { - dns.resolve('google.com', (err) => { - if (err == null) { - res(false); - } else { - res(true); - } - }); + dns.resolve('google.com', (err) => res(err != null)); }); return withTimeout(isOffline, 1e3).catch(() => true); } diff --git a/packages/wxt/src/utils/content-script-ui/shared.ts b/packages/wxt/src/utils/content-script-ui/shared.ts index c23b52eb..d1efea6e 100644 --- a/packages/wxt/src/utils/content-script-ui/shared.ts +++ b/packages/wxt/src/utils/content-script-ui/shared.ts @@ -213,7 +213,7 @@ function autoMountUi( } } } - observeElement(resolvedAnchor); + void observeElement(resolvedAnchor); return { stopAutoMount: _stopAutoMount }; }