question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Where do the types/* dependencies belong?

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
demurgoscommented, May 11, 2019

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.

1reaction
demurgoscommented, May 11, 2019

@types/* packages should have the same type as the corresponding implementation package. If foo is a peerDependency then @types/foo should be a peer dependency. If bar is a dependency 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found