better-typescript-lib
better-typescript-lib copied to clipboard
How is this different from ts-reset?
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.
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.
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().
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.