You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Josmithr
changed the title
[api-extractor]
[api-extractor] TSDoc references from non-internal API exports to internal exports does not error
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
andae-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
andbar
.foo
is@public
, andbar
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 justfoo
with a doc comment that links tobar
, 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:
@microsoft/api-extractor
version?node -v
)?The text was updated successfully, but these errors were encountered: