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

Using TypeScript or create types #136

Open
cyrdam opened this issue Oct 18, 2021 · 9 comments
Open

Using TypeScript or create types #136

cyrdam opened this issue Oct 18, 2021 · 9 comments

Comments

@cyrdam
Copy link
Contributor

cyrdam commented Oct 18, 2021

Hi, would it be possible to use this within TypeScript projects with good type support? (Directly within the repo or added to DefinitelyTyped)

@simonh1000
Copy link
Owner

I'm a fan of TypeScript but dont know when or if I'll get round to using it (and adding a compiled version for js users)

@cyrdam
Copy link
Contributor Author

cyrdam commented Oct 22, 2021

On a short look into it I already found issues within the code and also issues with old dependencies. This would do more than just refactor it to TypeScript.

I could try to do it, but am short on time. Maybe someone else might do it within that time would be great.

@shekharkhedekar
Copy link

I’d like to take this on. I’ll put up a pull request for this.

@simonh1000
Copy link
Owner

simonh1000 commented Apr 25, 2022 via email

@shekharkhedekar
Copy link

that works be great can I suggest that you try not to change the code beyond adding the types. you may well see refactorings and improvements to the algorithm, but review will be easier if the diff is easier to parse and refactoring is safer anyway once you have the types in place 😃

On Mon, 25 Apr 2022, 20:50 Shekhar Khedekar, @.> wrote: I’d like to take this on. I’ll put up a pull request for this. — Reply to this email directly, view it on GitHub <#136 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIDMFGXAYT3ULT6GSMYQVLVG3SPNANCNFSM5GGK3RKA . You are receiving this because you commented.Message ID: @.>

Great plan. Will keep the pull requests as small/focused as possible.

@shekharkhedekar
Copy link

@simonh1000 please add me as a collaborator on this repo

@simonh1000
Copy link
Owner

@cyrdam
Copy link
Contributor Author

cyrdam commented May 23, 2023

Using TypeScript can improve the maintainability and reliability of your code. While it may seem like an additional overhead for small projects, the benefits of using TypeScript far outweigh the initial setup effort. With TypeScript, you can catch potential issues early on and prevent them from causing problems down the line.

TypeScript also supports JSDoc, so you can still use normal JS files and have them validated with TypeScript using JSDoc comments. However, TypeScript is much more powerful than JSDoc and offers many more features.

If you’re concerned about being tied to a specific tool, keep in mind that you can always opt-out of using TypeScript and still have simple JS files in the end. The hurdle to switch is not as great as it may seem.

In summary, using TypeScript can help you maintain your code more effectively and prevent issues from arising. It’s a valuable tool that can benefit your project, regardless of its size.

@cyrdam
Copy link
Contributor Author

cyrdam commented Sep 10, 2023

A side note: I have found this little bug: #162.

Without a check on this object type it was easy to overlook it. I would welcome some kind of type checking here.

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

3 participants