// the find
mattpocock/ts-reset
A 'CSS reset' for TypeScript, improving types for common JavaScript API's
ts-reset patches TypeScript's built-in lib typings — things like `JSON.parse` returning `any` instead of `unknown`, and `Array.filter(Boolean)` not narrowing correctly. Drop it in as a dev dependency and reference it in a type-only import or triple-slash directive. No runtime code, just declaration files.
The `filter(Boolean)` fix alone is worth the install — the vanilla narrowing is genuinely broken and this does it right. Each fix lives in its own entrypoint so you can opt in selectively rather than swallowing the whole thing. The `.out-of-scope/` directory is refreshingly honest: it documents things they considered and rejected, with reasoning, rather than quietly omitting them. Test files use type-level assertions rather than runtime tests, which is the correct approach for a typings-only library.
The repo has 8.5k stars but only 138 forks and very low external contribution — it's effectively one person's opinions about how the stdlib should behave, which means if you disagree with a fix you're patching around the patch. Some changes (widening `array.includes`) are genuinely controversial and will surprise teammates who don't know ts-reset is installed. There's no mechanism to pin to a specific TypeScript version range, so a future lib change could make a fix redundant or conflicting with no clear upgrade path.