Skip to content

[Bug]: All packages have a direct dependency on @types/* regardless of whether TypeScript is used #32292

@tido64

Description

@tido64

Library

React / v8 (@fluentui/react)

System Info

n/a

Are you reporting an Accessibility issue?

None

Reproduction

https://github.com/microsoft/rnx-kit/blob/main/.yarnrc.yml#L21

Bug Description

As an example, @fluentui/utilities has a peer dependency on @type/react. This causes package managers to either warn or even fail (default with latest npm) if the consumer of the package does not also install the @types packages. However, it is not always the case that TypeScript is being used. Forcing users to install them in this scenario is unnecessary. Instead, we should mark them all as optional (example).

Logs

No response

Requested priority

Low

Products/sites affected

Anyone not using TypeScript

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions