-
Notifications
You must be signed in to change notification settings - Fork 85
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
@types/hapi__joi
needs to be a prod dependency
#106
Comments
@babramczyk, thanks for the issue, can I get a pr, would really appreciate this, typescript is not my thing, and I would ideally like someone who does use it to test it.. It also states 'or add a new declaration (.d.ts) file', can we do that instead? |
Sure thing. Should be a super simple fix. If you're not familiar with what's going on -- basically, since However, they will get your
This is referring to the consumer making a @declare module @hapi/joi {
ValidationOptions: ...
ValidationError: ...
Root: ...
} |
@AndrewKeig opened #109 |
hey @babramczyk , before i merge this, can i ask one more thing, would you mind adding a typescript example to the readme, we have this example in javascript, could you typescriptify it :). and stick it in the readme, with any notes. thanks.
|
So with that example, there's really no "typescriptifying" to be done With TypeScript, a lot of its compile-time checking will happen regardless of if you use type annotations or not. The only way to really communicate that this package "works" with TypeScript would be to modify your JS example to be an incorrect usage of the package, demonstrating that TypeScript would error; I'm not sure this is really helpful. tl;dr: TypeScript users don't need to do anything to use your package in a "TypeScript way", so your README doesn't need to add anything for it 🙂 |
:), cheers dude. |
Since the
index.d.ts
file relies onimport
ing the types derived from@types/hapi__joi
, and since packages consumingexpress-validation
needs their TS to compile, this needs to be adependency
instead of adevDependency
.Otherwise, consumers using TypeScript will get the following error:
The text was updated successfully, but these errors were encountered: