Are package.json peerDependencies transitive?

41 Views Asked by At

I'll ask my question in the form of an example. Let's assume there is a long dependency chain:

A --depends on--> B
A --depends on--> E
B --depends on--> C
C --depends on--> D
D --peer dependency on--> E
  • B and C don't use E.

Here's the question: should B and C's package.json specify a peerDependency on E (the same peerDependency found in D's package.json)?


This comment inspired my question:

I just checked jsdom already provides canvas in peerDependency ( https://github.com/jsdom/jsdom/blob/main/package.json )? Do we need to provide it again?

0

There are 0 best solutions below