require-see-tag-link
Require @see tags to contain a URL or a {@link} reference.
Targeted pattern scopeโ
This rule checks TypeDoc comments containing @see block tags that have non-empty content.
What this rule reportsโ
This rule reports @see tags whose content does not contain a URL (a scheme followed by ://, such as https://) or a {@link} inline-tag expression. Plain descriptive prose without an actual link target is flagged.
Empty @see tags are handled separately by typedoc/no-empty-see-tag and are not flagged by this rule.
Why this rule existsโ
@see tags are navigation aids. Their purpose is to point readers at a specific destination โ an external URL or a TypeScript symbol via {@link}. When a @see tag contains only prose like @see the related utilities, it fails at its core purpose: readers have no actionable link to follow.
Enforcing that @see contains a URL or {@link} expression keeps generated documentation clean and navigable, and nudges authors to express cross-references with explicit links rather than ambiguous descriptions.
โ Incorrectโ
/**
* Normalize user-provided input.
* @see String trimming documentation
*/
export function normalize(input: string): string {
return input.trim();
}
/**
* Widget component.
* @see
* Related widget factory.
*/
export class Widget {}
โ Correctโ
/**
* Normalize user-provided input.
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim
*/
export function normalize(input: string): string {
return input.trim();
}
/**
* Widget component.
* @see {@link WidgetFactory} for the preferred construction pattern.
*/
export class Widget {}
Behavior and migration notesโ
- This rule checks only
@seetags that already have content. Empty@seetags are out of scope (usetypedoc/no-empty-see-tagfor that). - A URL is detected by the presence of a recognised URI scheme followed by
://. The rule detects common schemes:file,ftp,ftps,git,http,https,mailto,ssh, andsvn. - A link is detected by the presence of a
{@linkexpression anywhere in the tag body. - Bare symbol names (e.g.,
@see MyClass) are not considered links by this rule. Use{@link MyClass}to make the reference explicit and tooling-friendly. - This rule does not autofix because the correct link target must be determined by the author.
ESLint flat config exampleโ
import typedocPlugin from "eslint-plugin-typedoc";
export default [
{
plugins: { typedoc: typedocPlugin },
rules: {
"typedoc/require-see-tag-link": "warn",
},
},
];
When not to use itโ
Disable this rule if your project uses @see for cross-references that are resolved outside of the TypeDoc {@link} mechanism, such as bare symbol names that a custom renderer handles, or if your documentation workflow intentionally allows descriptive @see text.
Package documentationโ
TypeDoc package documentation:
Further readingโ
Rule catalog ID: R031
Adoption resourcesโ
- Pair with
typedoc/no-empty-see-tagto cover both the empty case and the prose-only case together:no-empty-see-tagflags@seewith no content.require-see-tag-linkflags@seewith content that isn't a URL or{@link}.
- Both rules are enabled in
typedoc.configs.strictandtypedoc.configs.all.