TypeScript as a peerDependency
See original GitHub issueAre there any reasons this package has so old TypeScript peerDependency? It breaks the build:
ERROR @typescript-eslint/eslint-plugin > @typescript-eslint/experimental-utils > @typescript-eslint/typescript-estree: tsutils@3.21.0 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none was installed.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:10 (2 by maintainers)
Top Results From Across the Web
A tip on using peer dependencies with TypeScript
React is now a peer dependency, which means the main application needs to list it in its own dependencies. Additionally, we're able to...
Read more >Understanding Peer Dependencies in JavaScript
When to use peerDependencies? Peer dependencies really come into play when you're developing code that will be used by others, such as plugins ......
Read more >How do I handle optional peer dependencies when publishing ...
When publishing a TypeScript package to npm that provides a function that accepts input from either one peer dependency or another, how do...
Read more >typescript@ versions and peer dependencies - NPM Peer
Online Peer dependency version tool to search for compatible versions of related NPM packages.
Read more >peerDependencies are not regarded by import : WEB-51617
It is not possible to use peer dependencies in TypeScript. WebStorm does not recognize them and marks import statement as invalid.
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
I too came here through a eslint plugin which through a chain of dependencies and with npm v7 now installing
peerDependencies
, ends up bloating mynode_modules
with an unused typescript compiler:@ajafff One use case: having an eslint-config package that supports different environments conditionally, like JavaScript projects (no TS required) and TypeScript projects at the same time (example). This currently leads to a warning because of
tsutils
being included in packages like@typescript-eslint/eslint-plugin
:People keep having this issue because of
tsutils
, unfortunately:This is what peerDependenciesMeta was created for:
This would be the required change in
package.json
:Are you open to such a change?