Move `@types` packages to `dependencies` from `devDependencies`
See original GitHub issueBug report
- I have checked other issues to make sure this is not a duplicate.
Describe the bug
I have a following error after running tsc --noEmit
:
error TS7016: Could not find a declaration file for module 'yup'
This should be fixed by moving all @types
modules to dependencies, not devDependencies (I should not install type definitions for package that is not my dependency.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Move @types dependencies to devDependencies #862 - GitHub
We need them in dependencies so that their installed into packages that depend on dom5 as a regular dependency.
Read more >Move a module from devDependencies to ... - Stack Overflow
So, if you need to switch a dependency from devDependencies to dependecies you can go to your package.json and move manually with no...
Read more >npm move package from devdependencies to dependencies Code ...
Answers related to “npm move package from devdependencies to dependencies”. difference between devDependency and dependency · npm remove dev dependencies ...
Read more >Understanding and organizing dependencies in node packages
json in one of five dependency types: dependencies (default); devDependencies; peerDependencies; bundledDependencies; optionalDependencies.
Read more >Managing dependencies - AWS Documentation
To update the installed modules, the preceding npm install and yarn upgrade commands can be used. Either command updates the packages in node_modules...
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
Makes sense now. I will implement the fix by the end of the week.
If you have some spare time, I could merge a PR as soon as it lands.
Short answer is yes.
Files
src/constructors.ts
andsrc/rules.ts
export stuff that usesyup
types, therefore they (@types/yup
) should be available to the consumer (installing them as production dependencies). Example:Now, let’s say I use
inputRule
inside my code. My typescript doesn’t know whatYup.schema<T>
ortypeof Yup
means, because I don’t have@types/yup
package installed (as I don’t directly useyup
package). Hope this make sense. This is a longer answer, because you don’t useyup
only during development, but also in the distributed package.