Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[api-extractor] TSDoc references from non-internal API exports to internal exports does not error #5172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Josmithr opened this issue Mar 26, 2025 · 0 comments

Comments

@Josmithr
Copy link
Contributor

Josmithr commented Mar 26, 2025

Summary

Since API-Extractor does not include @internal API exports when generating its doc model, it is impossible for {@link} or {@inheritDoc} references from non-internal API exports to internal API exports to ever be resolved correctly.

API-Extractor has logic that checks for invalid references and reports them via the ae-unresolved-link and ae-unresolved-inheritdoc-reference settings, but the above situation does not trigger these rules.
Given that API-Extractor unconditionally excludes @internal API exports, this situation should ideally be caught.

Example

Consider a package with 2 API exports: foo and bar.
foo is @public, and bar is @internal.
foo's documentation contains {@link bar}.

The package has API-Extractor configured with ae-unresolved-link as an error.

Given that API-Extractor unconditionally strips @internal exports from its doc model, the result of running API-Extractor on this package will yield a model that contains just foo with a doc comment that links to bar, which does not exist in the model.

Repro steps

A repro of the above example can be found here: https://github.com/Josmithr/api-extractor-playground/tree/link-to-internal

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/api-extractor version? 7.52.2
Operating system? Linux
API Extractor scenario? docs (.api.json)
Would you consider contributing a PR? Yes
TypeScript compiler version? 5.8.2
Node.js version (node -v)? 20.19.0
@github-project-automation github-project-automation bot moved this to Needs triage in Bug Triage Mar 26, 2025
@Josmithr Josmithr changed the title [api-extractor] [api-extractor] TSDoc references from non-internal API exports to internal exports does not error Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs triage
Development

No branches or pull requests

1 participant