koa-better-modules / joi-router

Easy, rich and fully validated koa routing.
MIT License
4 stars 4 forks source link

Missing types #3

Closed mobilites-m closed 2 years ago

mobilites-m commented 2 years ago

Hey, hope you're doing great !

After trying to move from the initial koa-joi-router to this project, we ran into this weird issue where TypeScript is not finding any types corresponding to koa-better-modules/joi-router.

Issue

It happened as soon as we replaced :

Said error;

Could not find a declaration file for module '@koa-better-modules/joi-router'. 'C:/Dev/m-backend-workspace/node_modules/@koa-better-modules/joi-router/joi-router.js' implicitly has an 'any' type. Try npm i --save-dev @types/koa-better-modules__joi-router if it exists or add a new declaration (.d.ts) file containing declare module '@koa-better-modules/joi-router';

As per TypeScript Documentation on @types, the @koa-better-modules/joi-router is indeed not defined in the Types list.

Temporary solution

A temporary solution would be adding our own types as recommended by Typescript but it's very unlikely to be the most sustainable solution.

We would like to know if your team is considering adding the types for TypeScript projects. Thanks in advance

3imed-jaberi commented 2 years ago

I'll work on it soony and I will keep you updated when it's done!

3imed-jaberi commented 2 years ago

@mobilites-m, ts types added and published v10.1.0 🎉!

mobilites-m commented 2 years ago

@3imed-jaberi thank you very much it's working like a charm !