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

How is this different from ts-reset? #41

Open
EvgenyOrekhov opened this issue Jun 12, 2024 · 3 comments
Open

How is this different from ts-reset? #41

EvgenyOrekhov opened this issue Jun 12, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@EvgenyOrekhov
Copy link

I was wondering if I should use better-typescript-lib or https://github.com/total-typescript/ts-reset, or both.

Would be great to have a comparison in the README.

@graphemecluster
Copy link
Contributor

See #29 for an article that compares both libraries. IMO README is not the ideal place to do so as one may find it provocative.

@EvgenyOrekhov
Copy link
Author

Thanks for the link. Although, the article doesn't explain much in terms of concrete cases and examples. I understand that there's tons of changes to the core types, but it would be good to have more examples than just JSON.parse() and fetch().json().

@uhyo
Copy link
Owner

uhyo commented Jun 13, 2024

Hello, thank you for your interest!

While you can check the diffs to grasp the changes made to TypeScript's built-in type definitions, it is definitely good to have more concrete examples.

Basically better-typescript-lib aims to fix all definitions that are subpar, including ones that return any. I believe better-typescript-lib covers almost all cases that ts-reset provides fixes for.

Also there is architectual difference; better-typescript-lib actually replaces built-in type definitions while ts-reset only provides additional overloads. In general, the former approach is silgithly safer.

That said, on which to choose:

  • If you like opinionated, all-in-one solution, use better-typescript-lib.
  • If you want to get deeper understanding of each fix and choose which ones to apply to your project, use ts-reset.
  • It doesn't make sense to use both at the same time.

@uhyo uhyo added the documentation Improvements or additions to documentation label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants