From 2fb80b366dcf2aa616485dea797b34b2d79c5776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 21 Dec 2024 01:23:53 +0100 Subject: [PATCH] fmt --- www/main.ts | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/www/main.ts b/www/main.ts index 4fc57ffa..678fcdc0 100644 --- a/www/main.ts +++ b/www/main.ts @@ -1,20 +1,31 @@ -const rulePat = new URLPattern("https://lint.deno.land/rules/:rule", { ignoreCase: true}); +const rulePat = new URLPattern("https://lint.deno.land/rules/:rule", { + ignoreCase: true, +}); Deno.serve((req) => { - const url = new URL(req.url); + const url = new URL(req.url); - const ruleMatch = rulePat.exec(req.url); - const maybeRule = ruleMatch?.pathname.groups.rule; + const ruleMatch = rulePat.exec(req.url); + const maybeRule = ruleMatch?.pathname.groups.rule; - if (maybeRule) { - return Response.redirect(`https://docs.deno.com/lint/rules/${maybeRule}`, 301); - } + if (maybeRule) { + return Response.redirect( + `https://docs.deno.com/lint/rules/${maybeRule}`, + 301, + ); + } - if (url.pathname.startsWith("/ignoring-rules")) { - // TODO(bartlomieju): verify the anchor is not changed or use - // "go" url - return Response.redirect(`https://docs.deno.com/runtime/reference/cli/lint/#ignore-directives`, 301); - } + if (url.pathname.startsWith("/ignoring-rules")) { + // TODO(bartlomieju): verify the anchor is not changed or use + // "go" url + return Response.redirect( + `https://docs.deno.com/runtime/reference/cli/lint/#ignore-directives`, + 301, + ); + } - return Response.redirect("https://docs.deno.com/runtime/reference/cli/lint/", 304); -}) \ No newline at end of file + return Response.redirect( + "https://docs.deno.com/runtime/reference/cli/lint/", + 304, + ); +});