Where do the types/* dependencies belong?
See original GitHub issueI noticed that the dependencies for @types/pug
are in dependencies
but the @types/node
are in the devDependencies
- shouldn’t these both be in the same place? Which one is correct?
cc @demurgos
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How do I decide whether @types/* goes into `dependencies ...
I would think that @types should be in devDependencies , as types are needed for development and aren't used in runtime, but I...
Read more >Type-Level dependencies - IBM
Type-Level dependencies are applicable to relationships that arise after considering the possible set of values that a particular data field can contain.
Read more >7.2 Type Dependencies - Oracle Help Center
Type dependencies fall into two broad categories: Situations where types depend upon each other for their definitions, where one type might be part...
Read more >What are Dependencies? - CISA
Dependencies can be one-directional or bi-directional (also known as interdependencies*), and can be upstream or downstream. For example, the energy and water ...
Read more >Dependencies - Gentoo Development Guide
Build Dependencies BDEPEND specifies dependencies applicable to CBUILD, i.e. programs that need to be executed during the build, e.g. virtual/pkgconfig . ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
By the way,
@types/*
is not only useful for Typescript users. It powers the VS Code’s and Jetbrains autocompletion/quick doc/refactoring, so it’s another reason why the dependency types should match. I wrote a small post about it.@types/*
packages should have the same type as the corresponding implementation package. Iffoo
is apeerDependency
then@types/foo
should be a peer dependency. Ifbar
is adependency
then@types/bar
should be a regular dependency. It helps ensuring that the declaration and implementation live at the same level in the dependency tree and are picked up properly.@types/node
is a special case because there’s no corresponding package.