Skip to content
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

.d.ts declaration files for better type safety and readability #12

Open
WillsterJohnson opened this issue May 22, 2022 · 0 comments
Open

Comments

@WillsterJohnson
Copy link

The majority of packages on npm use TypeScript in some form or another, and the ones which don't have 3rd party .d.ts declaration files written over at Definitely Typed.

I would like to do one of two things;

  1. Convert the project over to TypeScript
  2. Write .d.ts definition files for the project

In the case of converting to TypeScript, I will pick the most forgiving compilerOptions so that someone with zero knowledge could still come to this project and contribute, esentially the only types necessary will be function parameters and placeholder variables, though type safety could still be improved with further typings such as interfaces and function generics.
The project's build step will compile from a new source directory src to an output directory dist, and all pointers in package.json will be modified accordingly.

In the case of writing .d.ts declaration files, I will be doing the TypeScript compiler's job of extracting type definitions an putting them in .d.ts files. All functions and file-level variables, exported or not, will be typed, and we'll get a few useful interfaces out of it as well, which could solve some of the JSDoc spaghetti this project is beginning to run into.


Please let me know if you would like this feature implemented and I will begin working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant