Skip to content

Should @types packages be dependencies or devDependencies? #14508

Description

@trusktr

This isn't a bug or feature request, but I noticed that there are @types/ packages in the dependencies section of @material-ui/core. Shouldn't they be devDependencies instead? Or is there a reason for them to be dependencies?

Just wondering, because they current cause some errors in my app:

> tsc -p ./tsconfig.json --noEmit

node_modules/@types/react-transition-group/node_modules/@types/react/index.d.ts:2746:14 - error TS2300: Duplicate identifier 'LibraryManagedAttributes'.

2746         type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
                  ~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/@types/react/index.d.ts:2744:14
    2744         type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
                      ~~~~~~~~~~~~~~~~~~~~~~~~
    'LibraryManagedAttributes' was also declared here.

node_modules/@types/react/index.d.ts:2744:14 - error TS2300: Duplicate identifier 'LibraryManagedAttributes'.

2744         type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
                  ~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/@types/react-transition-group/node_modules/@types/react/index.d.ts:2746:14
    2746         type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
                      ~~~~~~~~~~~~~~~~~~~~~~~~
    'LibraryManagedAttributes' was also declared here.


Found 2 errors.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions