diff --git a/biome.json b/biome.json index da969039..668a9fc6 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/1.5.0/schema.json", + "$schema": "https://biomejs.dev/schemas/1.6.0/schema.json", "organizeImports": { "enabled": true }, @@ -15,7 +15,9 @@ "nursery": { "all": true, "useImportRestrictions": "off", - "useFilenamingConvention": "off" + "useJsxKeyInIterable": "off", + "useSortedClasses": "off", + "noConsole": "off" }, "style": { "noImplicitBoolean": "off", diff --git a/deno.json b/deno.json index 90b32226..2166fde2 100644 --- a/deno.json +++ b/deno.json @@ -17,7 +17,7 @@ "esm:add": "deno task esm add", "esm:update": "deno task esm update", "esm:remove": "deno task esm remove", - "biome": "deno run -A npm:@biomejs/biome@1.5.3", + "biome": "deno run -A npm:@biomejs/biome@1.6.0", "biome:ci": "deno task biome ci . --error-on-warnings", "biome:check": "deno task biome check . --error-on-warnings", "compile:mdx": "deno run -A tool/compile-mdx.ts", diff --git a/src/routes/solutions/[category]/[[slug]].tsx b/src/routes/solutions/[category]/[[slug]].tsx index e5d56934..9e2e7ba8 100644 --- a/src/routes/solutions/[category]/[[slug]].tsx +++ b/src/routes/solutions/[category]/[[slug]].tsx @@ -32,7 +32,7 @@ export const handler: Handlers = { try { const { category, slug } = ctx.params; if (category === undefined) { - return ctx.renderNotFound(); + return await ctx.renderNotFound(); } const base = join(contentDir, category); @@ -41,7 +41,7 @@ export const handler: Handlers = { const file: MdxFile = await import(filepath); - return ctx.render({ page: file }); + return await ctx.render({ page: file }); } catch (e) { console.error(e); diff --git a/src/routes/solutions/[category]/index.tsx b/src/routes/solutions/[category]/index.tsx index 05d9ff8c..f106b0b7 100644 --- a/src/routes/solutions/[category]/index.tsx +++ b/src/routes/solutions/[category]/index.tsx @@ -33,14 +33,14 @@ const categoryProps = z.object({ * The server handler for the solution page. */ export const handler: Handlers = { - GET( + async GET( _req: Request, ctx: FreshContextHelper, - ): Response | Promise { + ): Promise { try { const { category } = ctx.params; if (category === undefined || !isKey(categoryMetadata, category)) { - return ctx.renderNotFound(); + return await ctx.renderNotFound(); } let data: CategoryData[] = []; @@ -62,7 +62,7 @@ export const handler: Handlers = { } } - return ctx.render({ + return await ctx.render({ pages: categoryPropsPages.parse(data), title: categoryMetadata[category].title, description: categoryMetadata[category].description, @@ -70,7 +70,7 @@ export const handler: Handlers = { } catch (e) { console.error(e); - return ctx.renderNotFound(); + return await ctx.renderNotFound(); } }, }; diff --git a/tool/compile-mdx.ts b/tool/compile-mdx.ts index 6c282835..bea21edc 100644 --- a/tool/compile-mdx.ts +++ b/tool/compile-mdx.ts @@ -73,7 +73,6 @@ async function run(): Promise { * @remarks * This is an async generator because it's recursive. */ -// biome-ignore lint/nursery/useAwait: for-await isn't caught correctly. async function* getSolutions( basePath: string, currentPath: string = basePath, @@ -134,7 +133,6 @@ function lint(files: VFile[]): void { * @param initialFiles A list of virtual MDX files for compilation. * @returns A list of virtual JS files. */ -// biome-ignore lint/nursery/useAwait: for-await isn't caught correctly. async function* compileSolutions( initialFiles: AsyncIterable, ): AsyncGenerator { @@ -202,8 +200,8 @@ async function writeSolutions(solutions: VFile[]): Promise { * @param solution A file to write. * @returns A promise resolving when the file's written. */ -function writeSolution(solution: VFile): Promise { - return Deno.writeTextFile( +async function writeSolution(solution: VFile): Promise { + return await Deno.writeTextFile( join(contentDir, solution.path), solution.toString(), );