From 65e6385bc4deddeb32f0186b5903db711df60915 Mon Sep 17 00:00:00 2001 From: duffn <3457341+duffn@users.noreply.github.com> Date: Sun, 4 Jun 2023 23:01:53 -0600 Subject: [PATCH] docs: add `_` prefix to unused requests params (#1007) - add types to handlers in the Getting Started section to align with the examples in the Concepts section - prefix unused arguments with `_` as suggested by official VSCode plugin linting. --------- Co-authored-by: Asher Gomez --- docs/getting-started/custom-handlers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/getting-started/custom-handlers.md b/docs/getting-started/custom-handlers.md index 766af258..169803df 100644 --- a/docs/getting-started/custom-handlers.md +++ b/docs/getting-started/custom-handlers.md @@ -33,7 +33,7 @@ then adds a custom header to the response before returning it: import { Handlers } from "$fresh/server.ts"; export const handler: Handlers = { - async GET(req, ctx) { + async GET(_req, ctx) { const resp = await ctx.render(); resp.headers.set("X-Custom-Header", "Hello"); return resp; @@ -60,7 +60,7 @@ response: import { Handlers } from "$fresh/server.ts"; export const handler: Handlers = { - GET(req) { + GET(_req) { const uuid = crypto.randomUUID(); return new Response(JSON.stringify(uuid), { headers: { "Content-Type": "application/json" },