-
-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript compilation error #175
Comments
The way I see it (though I could be persuaded otherwise), type definitions should always be devDependendencies. They're not needed at runtime, and they're not needed at all for anyone who isn't using TypeScript. If you are using TypeScript, then you are take a devDependency on the type packages that are needed to make TypeScript work, including types that are needed by third-party libs. I'd be curious to hear what other people think about this. I could certainly be persuaded to move types to dependencies, but I suspect that some folks (especially those who aren't using TypeScript) won't like that because it pollutes their runtime node_modules. |
@JamesMessinger I completely understand your reasoning. I'm curious as to why I haven't encountered this with other packages. Do you know if installing the types as a dev dependency from DefinitelyTyped automatically takes care of this? |
Now that TypeScript is rapidly growing in popularity, I suspect this issue will come up more frequently and the community will (hopefully) agree on a standard approach or solution to the problem. 🤞 Installing the types as a dev dependency will solve the problem. I do that in a few of my apps for some third-party libs. |
TypeScript reports the following compilation error, due to this line.
@types/json-schema
is listed as a development dependency, but isn't installed along with your package.Explicitly installing
@types/json-schema
as a development dependency fixes the error.Is this expected behaviour? I'm pretty new to TypeScript.
The text was updated successfully, but these errors were encountered: