edwardfxiao/react-inputs-validation

Improve TypeScript support

rxkevin opened this issue ยท 9 comments

Screenshot 2020-12-01 at 18 04 46

Currently, no TS declarations are exported with the package, which does not make it developer-friendly. Even though, I see typescript is being used in the development of this package. Please, just add "declaration": true, to your tsconfig, and modify your build scripts accordingly if needed.

Hi @rxkevin, I have updated the version to 4.6.0, not sure if it works, can you check it out?

First of all, forgot to mention, good work on this package!

One step closer, types are now included in the package, however, index.d.ts must be in the root of your package, where now it is in the root/lib directory. As mentioned, you will probably need to modify your build script, or set "declarationDir": "./" in tsconfig.

Screenshot 2020-12-02 at 09 17 41

Also, type definitions could be improved for each component. A lot of parameters use abstract types, which is not that helpful either.

Screenshot 2020-12-02 at 09 22 32

Is it possible that you can create a PR for this?

I'm short on time but I will try to make it this week hopefully.

Does v4.6.2 meet the expectation?

It does! We can close this issue now.

@all-contributors please add @RokasAniss for code

@edwardfhsiao

I've put up a pull request to add @RokasAniss! ๐ŸŽ‰