Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinhagemeister committed Oct 4, 2024
1 parent 3ae2b9c commit 05a90d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/plugins/fs_routes/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { WalkEntry } from "@std/fs/walk";
import * as path from "@std/path";
import type { RouteConfig } from "../../types.ts";
import type { RouteHandler } from "../../handlers.ts";
import type { Middleware, MiddlewareFn } from "../../middlewares/mod.ts";
import type { MiddlewareFn } from "../../middlewares/mod.ts";
import {
type AsyncAnyComponent,
renderMiddleware,
Expand Down Expand Up @@ -34,8 +34,7 @@ export interface FreshFsItem<State> {
handlers?: RouteHandler<unknown, State>;
default?:
| AnyComponent<PageProps<unknown, State>>
| AsyncAnyComponent<PageProps<unknown, State>>
| Middleware<State>;
| AsyncAnyComponent<PageProps<unknown, State>>;
}

// deno-lint-ignore no-explicit-any
Expand Down
5 changes: 3 additions & 2 deletions src/plugins/fs_routes/mod_test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,11 @@ Deno.test("fsRoutes - middleware", async () => {
const server = await createServer<{ text: string }>({
"routes/index.ts": { handler: (ctx) => new Response(ctx.state.text) },
"routes/_middleware.ts": {
default: (ctx: FreshContext<{ text: string }>) => {
default: ((ctx: FreshContext<{ text: string }>) => {
ctx.state.text = "ok";
return ctx.next();
},
// deno-lint-ignore no-explicit-any
}) as any,
},
});

Expand Down

0 comments on commit 05a90d3

Please sign in to comment.