From a2171ea258e839bef0354b7cd0415be80bbb18cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Charles?= Date: Sat, 24 Aug 2024 19:49:08 +0200 Subject: [PATCH] chore: lint --- package.json | 2 +- packages/vike-cloudflare/src/index.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7123f4b..36f13e2 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "build": "cd packages/vike-cloudflare && pnpm run build", "release": "cd packages/vike-cloudflare && pnpm run release", "========= Test": "", - "test": "pnpm run test:units && pnpm run test:e2e && pnpm run test:types", + "test": "pnpm run lint && pnpm run test:units && pnpm run test:e2e && pnpm run test:types", "test:e2e": "test-e2e", "test:units": "pnpm --recursive --sequential --filter {packages/*} run test", "test:types": "test-types", diff --git a/packages/vike-cloudflare/src/index.ts b/packages/vike-cloudflare/src/index.ts index 5c35874..254d08d 100644 --- a/packages/vike-cloudflare/src/index.ts +++ b/packages/vike-cloudflare/src/index.ts @@ -2,7 +2,7 @@ import { cp, mkdir, rm, symlink, writeFile } from "node:fs/promises"; import { builtinModules } from "node:module"; import { dirname, isAbsolute, join, posix } from "node:path"; import { prerender } from "vike/prerender"; -import { type Plugin, type ResolvedConfig, normalizePath } from "vite"; +import { normalizePath, type Plugin, type ResolvedConfig } from "vite"; import hattipAsset from "../assets/hattip.js?raw"; import honoAsset from "../assets/hono.js?raw"; import vikeAsset from "../assets/vike.js?raw"; @@ -59,7 +59,7 @@ export const pages = (options?: VikeCloudflarePagesOptions): Plugin[] => { name: NAME, enforce: "post", apply(config) { - return !!config.build?.ssr; + return Boolean(config.build?.ssr); }, resolveId(id) { if (id === virtualEntryId) { @@ -100,6 +100,7 @@ export const pages = (options?: VikeCloudflarePagesOptions): Plugin[] => { }, configResolved: async (config) => { resolvedConfig = config; + // biome-ignore lint/suspicious/noExplicitAny: TODO shouldPrerender = !!(await (config as any).configVikePromise).prerender; }, options(inputOptions) { @@ -216,6 +217,7 @@ function assert(condition: unknown, message: string): asserts condition { async function prerenderPages() { const filePaths: string[] = []; await prerender({ + // biome-ignore lint/suspicious/noExplicitAny: TODO async onPagePrerender(page: any) { const result = page._prerenderResult; filePaths.push(result.filePath);