From e33cef777102bc8592a3448f2e3193111bb29431 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Tue, 21 Jul 2026 08:12:12 +0800 Subject: [PATCH] fix(http): restore historical linter rule reference doc url The tspd change that auto-generates one reference page per linter rule (#11221) moved the http rule page from `libraries/http/rules/` to `libraries/http/reference/rules/`, which broke the existing rule documentation url (the rule's own `url` field, external links, and diagnostic "see documentation" links all point at the historical location). Use the `--rules-dir ../rules` option (added in #11316) in http's `regen-docs` so the rule pages are written back to `libraries/http/rules/`, restoring the original url. Regenerate the docs and re-enable the sidebar Rules group. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de8537de-5e61-4a0d-b2de-59ec12c15dc4 --- .chronus/changes/fix-http-linter-rule-doc-url-2026-7-21.md | 7 +++++++ packages/http/package.json | 2 +- website/src/content/current-sidebar.ts | 2 +- .../content/docs/docs/libraries/http/reference/linter.md | 6 +++--- .../{reference => }/rules/op-reference-container-route.md | 0 5 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 .chronus/changes/fix-http-linter-rule-doc-url-2026-7-21.md rename website/src/content/docs/docs/libraries/http/{reference => }/rules/op-reference-container-route.md (100%) diff --git a/.chronus/changes/fix-http-linter-rule-doc-url-2026-7-21.md b/.chronus/changes/fix-http-linter-rule-doc-url-2026-7-21.md new file mode 100644 index 00000000000..3a77c63e914 --- /dev/null +++ b/.chronus/changes/fix-http-linter-rule-doc-url-2026-7-21.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/http" +--- + +Keep the generated linter rule reference pages at their historical `libraries/http/rules/` location so existing rule documentation URLs stay stable. diff --git a/packages/http/package.json b/packages/http/package.json index 812e7695015..368611b2d53 100644 --- a/packages/http/package.json +++ b/packages/http/package.json @@ -66,7 +66,7 @@ "test:ci": "vitest run --coverage --reporter=junit --reporter=default", "lint": "oxlint . --deny-warnings", "lint:fix": "oxlint . --fix", - "regen-docs": "tspd doc . --enable-experimental --typekits --llmstxt --output-dir ../../website/src/content/docs/docs/libraries/http/reference" + "regen-docs": "tspd doc . --enable-experimental --typekits --llmstxt --output-dir ../../website/src/content/docs/docs/libraries/http/reference --rules-dir ../rules" }, "files": [ "lib/**/*.tsp", diff --git a/website/src/content/current-sidebar.ts b/website/src/content/current-sidebar.ts index a086939ec4f..c0119ce3ebd 100644 --- a/website/src/content/current-sidebar.ts +++ b/website/src/content/current-sidebar.ts @@ -124,7 +124,7 @@ const sidebar: SidebarItem[] = [ { label: "📚 Libraries", items: [ - createLibraryReferenceStructure("libraries/http", "Http", false, [ + createLibraryReferenceStructure("libraries/http", "Http", true, [ "libraries/http/cheat-sheet", "libraries/http/authentication", "libraries/http/operations", diff --git a/website/src/content/docs/docs/libraries/http/reference/linter.md b/website/src/content/docs/docs/libraries/http/reference/linter.md index f6e795cd91e..d51c365da51 100644 --- a/website/src/content/docs/docs/libraries/http/reference/linter.md +++ b/website/src/content/docs/docs/libraries/http/reference/linter.md @@ -20,6 +20,6 @@ Available ruleSets: ## Rules -| Name | Description | -| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| [`@typespec/http/op-reference-container-route`](./rules/op-reference-container-route.md) | Check for referenced (`op is`) operations which have a @route on one of their containers. | +| Name | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| [`@typespec/http/op-reference-container-route`](../rules/op-reference-container-route.md) | Check for referenced (`op is`) operations which have a @route on one of their containers. | diff --git a/website/src/content/docs/docs/libraries/http/reference/rules/op-reference-container-route.md b/website/src/content/docs/docs/libraries/http/rules/op-reference-container-route.md similarity index 100% rename from website/src/content/docs/docs/libraries/http/reference/rules/op-reference-container-route.md rename to website/src/content/docs/docs/libraries/http/rules/op-reference-container-route.md