Skip to content

Commit 0a716b2

Browse files
committed
Fix relative links to README file
Resolves #3006
1 parent 51c7ff2 commit 0a716b2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+255
-340
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ title: Changelog
99
- Variables marked with `@enum` now work for symbols imported from another module, #3003.
1010
- Improved magic introduced with #2999 to work with imported symbols, #3003.
1111
- Fixed relative link resolution to file names containing percent encoded URLs, #3006.
12+
- Linking to the project's README file with a relative link will now behave as expected, #3006.
13+
- Reduced unnecessary HTML element rendering in default theme.
14+
API: `Reflection.hasComment` and `Comment.hasVisibleComponent` now accepts an optional `notRenderedTags` parameter.
1215

1316
## v0.28.11 (2025-08-25)
1417

eslint.config.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ const config = {
5353
// This is sometimes useful for clarity
5454
"@typescript-eslint/no-unnecessary-type-arguments": "off",
5555

56+
// It'd be kind of nice to be able to turn this on, but it doesn't seem to be worth the additional
57+
// pain at this point. Turning it on adds ~300 lint errors, of which manual review found 1 bug, and
58+
// whose suggestions would have introduced 3 bugs that I noticed, and potentially more... and it
59+
// also didn't catch the bug which I originally turned it on for! Ideally, I'd like a version of
60+
// this which ONLY checks for boolean comparisons of type number.
61+
"@typescript-eslint/strict-boolean-expressions": "off",
62+
5663
// We still use `any` fairly frequently...
5764
"@typescript-eslint/ban-types": "off",
5865
"@typescript-eslint/no-explicit-any": "off",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@
5050
"c8": "^10.1.3",
5151
"dprint": "^0.50.1",
5252
"esbuild": "^0.25.8",
53-
"eslint": "^9.32.0",
53+
"eslint": "^9.34.0",
5454
"mocha": "^11.7.1",
5555
"puppeteer": "^24.11.1",
5656
"semver": "^7.7.2",
5757
"tsx": "^4.20.3",
5858
"typescript": "5.9.2",
59-
"typescript-eslint": "^8.38.0"
59+
"typescript-eslint": "^8.41.0"
6060
},
6161
"files": [
6262
"/bin",

pnpm-lock.yaml

Lines changed: 72 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ export {
141141
type NormalizedPathOrModule,
142142
type NormalizedPathOrModuleOrFunction,
143143
type SymbolReference,
144+
type TagString,
144145
type TranslatedString,
145146
translateTagName,
146147
} from "#utils";

src/lib/converter/comments/parser.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import assert, { ok } from "assert";
22
import { parseDocument as parseYamlDoc } from "yaml";
33
import type { CommentContextOptionalChecker, CommentParserConfig } from "./index.js";
44
import { Comment, type CommentDisplayPart, CommentTag, type InlineTagDisplayPart } from "../../models/index.js";
5-
import type { MinimalSourceFile } from "#utils";
5+
import type { MinimalSourceFile, TagString } from "#utils";
66
import { nicePath } from "../../utils/paths.js";
77
import { type Token, TokenSyntaxKind } from "./lexer.js";
88
import { extractTagName } from "./tagName.js";
@@ -235,7 +235,7 @@ export function parseCommentString(
235235
return { content, frontmatter: frontmatterData };
236236
}
237237

238-
const HAS_USER_IDENTIFIER: `@${string}`[] = [
238+
const HAS_USER_IDENTIFIER: TagString[] = [
239239
"@callback",
240240
"@param",
241241
"@prop",
@@ -389,7 +389,7 @@ function blockTag(
389389
content = blockContent(comment, lexer, config, i18n, warning, files);
390390
}
391391

392-
return new CommentTag(tagName as `@${string}`, content);
392+
return new CommentTag(tagName as TagString, content);
393393
}
394394

395395
/**
@@ -613,11 +613,11 @@ function blockContent(
613613
next.text = "@inheritDoc";
614614
}
615615
if (config.modifierTags.has(next.text)) {
616-
comment.modifierTags.add(next.text as `@${string}`);
616+
comment.modifierTags.add(next.text as TagString);
617617
break;
618618
} else if (!atNewLine && !config.blockTags.has(next.text)) {
619619
// Treat unknown tag as a modifier, but warn about it.
620-
comment.modifierTags.add(next.text as `@${string}`);
620+
comment.modifierTags.add(next.text as TagString);
621621
warning(
622622
i18n.treating_unrecognized_tag_0_as_modifier(next.text),
623623
next,
@@ -751,7 +751,7 @@ function inlineTag(
751751

752752
const inlineTag: InlineTagDisplayPart = {
753753
kind: "inline-tag",
754-
tag: tagName.text as `@${string}`,
754+
tag: tagName.text as TagString,
755755
text: content.join(""),
756756
};
757757
if (tagName.tsLinkTarget) {

src/lib/converter/plugins/CommentPlugin.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
removeIf,
2323
removeIfPresent,
2424
setIntersection,
25+
type TagString,
2526
unique,
2627
} from "#utils";
2728
import { ConverterComponent } from "../components.js";
@@ -56,7 +57,7 @@ const NEVER_RENDERED = [
5657
// We might make this user configurable at some point, but for now,
5758
// this set is configured here.
5859
const MUTUALLY_EXCLUSIVE_MODIFIERS = [
59-
new Set<`@${string}`>([
60+
new Set<TagString>([
6061
"@alpha",
6162
"@beta",
6263
"@experimental",
@@ -122,10 +123,10 @@ const MUTUALLY_EXCLUSIVE_MODIFIERS = [
122123
*/
123124
export class CommentPlugin extends ConverterComponent {
124125
@Option("excludeTags")
125-
accessor excludeTags!: `@${string}`[];
126+
accessor excludeTags!: TagString[];
126127

127128
@Option("cascadedModifierTags")
128-
accessor cascadedModifierTags!: `@${string}`[];
129+
accessor cascadedModifierTags!: TagString[];
129130

130131
@Option("excludeInternal")
131132
accessor excludeInternal!: boolean;

0 commit comments

Comments
 (0)