Skip to content

Commit 198e6e2

Browse files
committed
chore(linter): only hyperlink rule names when docs URL exists (#16536)
PR #16496 converted all rule names to hyperlinks, but some rules lack documentation URLs, creating broken markdown links like `[react/static-components]()`. ## Changes - Modified `tasks/lint_rules/src/markdown-renderer.mjs` to conditionally render hyperlinks only when `docsUrl` is non-empty - Rules with documentation URLs render as `[name](url)` - Rules without documentation URLs render as plain text `name` **Before:** ```markdown | ✅ | [react/jsx-key](https://github.com/.../jsx-key.md) | | | [react/static-components]() | ``` **After:** ```markdown | ✅ | [react/jsx-key](https://github.com/.../jsx-key.md) | | | react/static-components | ``` <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > Review #16496 and action the most recent comment on it regarding misisng hyperlinks </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
1 parent 767db50 commit 198e6e2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tasks/lint_rules/src/markdown-renderer.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ ${views
8080
if (v.isImplemented) status += "✅";
8181
if (v.isNotSupported) status += "🚫";
8282
if (v.isPendingFix) status += "⏳";
83-
return `| ${status} | [${v.name}](${v.docsUrl}) |`;
83+
const name = v.docsUrl ? `[${v.name}](${v.docsUrl})` : v.name;
84+
return `| ${status} | ${name} |`;
8485
})
8586
.join("\n")}
8687

0 commit comments

Comments
 (0)