Skip to content

Commit

Permalink
Merge pull request #25 from PHS-TSA/biome-1-6
Browse files Browse the repository at this point in the history
Update Biome to version 1.6.0
  • Loading branch information
lishaduck authored Mar 10, 2024
2 parents f4a8aef + 4a480b8 commit 2d5008a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 4 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -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
},
Expand All @@ -15,7 +15,9 @@
"nursery": {
"all": true,
"useImportRestrictions": "off",
"useFilenamingConvention": "off"
"useJsxKeyInIterable": "off",
"useSortedClasses": "off",
"noConsole": "off"
},
"style": {
"noImplicitBoolean": "off",
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/routes/solutions/[category]/[[slug]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const handler: Handlers<SolutionProps> = {
try {
const { category, slug } = ctx.params;
if (category === undefined) {
return ctx.renderNotFound();
return await ctx.renderNotFound();
}

const base = join(contentDir, category);
Expand All @@ -41,7 +41,7 @@ export const handler: Handlers<SolutionProps> = {

const file: MdxFile = await import(filepath);

return ctx.render({ page: file });
return await ctx.render({ page: file });
} catch (e) {
console.error(e);

Expand Down
10 changes: 5 additions & 5 deletions src/routes/solutions/[category]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ const categoryProps = z.object({
* The server handler for the solution page.
*/
export const handler: Handlers<CategoryProps> = {
GET(
async GET(
_req: Request,
ctx: FreshContextHelper<CategoryProps>,
): Response | Promise<Response> {
): Promise<Response> {
try {
const { category } = ctx.params;
if (category === undefined || !isKey(categoryMetadata, category)) {
return ctx.renderNotFound();
return await ctx.renderNotFound();
}

let data: CategoryData[] = [];
Expand All @@ -62,15 +62,15 @@ export const handler: Handlers<CategoryProps> = {
}
}

return ctx.render({
return await ctx.render({
pages: categoryPropsPages.parse(data),
title: categoryMetadata[category].title,
description: categoryMetadata[category].description,
});
} catch (e) {
console.error(e);

return ctx.renderNotFound();
return await ctx.renderNotFound();
}
},
};
Expand Down
6 changes: 2 additions & 4 deletions tool/compile-mdx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ async function run(): Promise<void> {
* @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,
Expand Down Expand Up @@ -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<VFile>,
): AsyncGenerator<VFile, void, unknown> {
Expand Down Expand Up @@ -202,8 +200,8 @@ async function writeSolutions(solutions: VFile[]): Promise<void> {
* @param solution A file to write.
* @returns A promise resolving when the file's written.
*/
function writeSolution(solution: VFile): Promise<void> {
return Deno.writeTextFile(
async function writeSolution(solution: VFile): Promise<void> {
return await Deno.writeTextFile(
join(contentDir, solution.path),
solution.toString(),
);
Expand Down

0 comments on commit 2d5008a

Please sign in to comment.