From 217f44b49dfc7af0860104644fcbe176c1c7a554 Mon Sep 17 00:00:00 2001 From: Bruno Heridet Date: Sun, 5 May 2024 07:50:26 +0200 Subject: [PATCH] feat(www): add link to rule source on GitHub (#1264) By following this link users can learn how the rule is implemented, and discover details about corner cases. Also it eases potential contributions, if something needs to be fixed or improved about the current rule. --- www/routes/rules/[name].tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/www/routes/rules/[name].tsx b/www/routes/rules/[name].tsx index 225d4723f..36d57dddf 100644 --- a/www/routes/rules/[name].tsx +++ b/www/routes/rules/[name].tsx @@ -1,3 +1,5 @@ +import IconBrandGithub from "https://deno.land/x/tabler_icons_tsx@0.0.5/tsx/brand-github.tsx"; + import jsonData from "../../static/docs.json" with { type: "json" }; import { Handlers, PageProps } from "$fresh/server.ts"; @@ -26,6 +28,9 @@ export const handler: Handlers = { export default function RulePage(props: PageProps) { const rule: RuleData = props.data; + const ruleSlug = rule.code.replaceAll("-", "_"); + const sourceLink = + `https://github.com/denoland/deno_lint/blob/main/src/rules/${ruleSlug}.rs`; return (
@@ -42,6 +47,15 @@ export default function RulePage(props: PageProps) {
+
); }