Recommended approach for using flow-typed with peerDependencies
See original GitHub issueI have a library that exports a number of reusable React components, and I am trying to add flow typings to it. As is best practice for libraries built with React, “react” is listed in both peerDependencies (to specify compatibility with the consuming application) and devDependencies (for component unit tests within my library). However, this configuration does not work with the flow-typed cli because of its duplicate dependency check.
What is the recommended approach for resolving this? Naively, it seems like we might want to allow duplicate dependencies in peerDependencies and devDependencies, but I don’t know what the implications are.
❯ flow-typed version
flow-typed@2.0.0-beta.11
❯ flow-typed install --overwrite
• Found flow-bin@v0.33.0 installed. Installing libdefs compatible with this version of Flow...
UNCAUGHT ERROR: Error: Found react listed twice in package.json!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:19
- Comments:14 (10 by maintainers)
Top Results From Across the Web
Understanding Peer Dependencies in JavaScript
Peer dependencies really come into play when you're developing code that will be used by others, such as plugins and packages.
Read more >Learning Flow - Alasdair McLeay
I recently came across the following flow type definition: declare export type StyledShorthandFactory<V> = {| [[call]]: <StyleProps, Theme>( string[],
Read more >@leeruniek/eslint-config - npm
Start using @leeruniek/eslint-config in your project by running `npm i ... JavaScript ESLint bundle with best practices and common use rules for writing ......
Read more >npm Peer Dependencies - JavaScript inDepth
We use Dependencies and Peer Dependencies in package.json to tell these other projects what packages also need to ... So I recommend the...
Read more >Using Typescript over Flow. · f790282c08 - react-mui-mapbox ...
"plugin:prettier/recommended". ],. "parserOptions": { ... /flow-typed .rpt2_cache/ ... import for use with developing component from copy of source.
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
peerDependencies
should not be considered a duplicate at all, it is a specification for a runtime dependency. Onlydependencies
anddevDependencies
should be considered for duplicates.Could this be fixed? Workaround is just to remove peer at
flow-typed install
time, but that seems very unnecessary…