Skip to content

[api-extractor] Error when imported types are used in @public-like interfaces but their library is not declared as a peerDependency or dependency  #3846

Open
@TheLarkInn

Description

@TheLarkInn

Summary

In the case of this bug: #3844

If a type is imported from an installed library, and that library is not declared as a dependency/peerDependency, api-extractor should error/throw when the user attempts to use it in any @public-like interfaces.

Repro steps

  1. Library uses api-extractor to create typings
  2. Library imports a libraries types into their code
  3. Library uses that type in an @public-like interface

Expected result:
api-extractor should throw, and then inform the user that they are attempting to use a type/import of a package that is not declared as a dependency/peerDependency in an @import-like interface.

Actual result:
api-extractor does not throw, and allows a user to publish anyways

Then bugs like these (#3844) happen less often.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThe issue is asking for a new feature or design changehelp wantedIf you're looking to contribute, this issue is a good place to start!needs designThe next step is for someone to propose the details of an approach for solving the problem

    Type

    No type

    Projects

    Status

    AE/AD

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions