Skip to content

feat: normalize and enforce@type package dependencies #319

Open
@Hotell

Description

@Hotell

Follows #316

ATM we specify @types/* as peerDependencies. With the new behaviour added to package managers for auto installing peerDependencies, this approach adds unwanted behaviour for users not using TypeScript as part of their CI toolchain.

For that reason we should enforce following patterns when specifying dependencies:

If package has production dependency ( peer or prod ) which doesn't ship types as part of the package (eg react, react-dom ) a @types/* package needs to exists as peerDependency with additional peerDependenciesMeta definition that marks this type package as optional.

Implementation:

  • add this functionality to @nx/dependency-check rule or
  • handle on our own via either
    • custom lint rule
    • nx sync generator

Related issues:

microsoft/fluentui#32292

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions