TScert only accepts TypeScript functions it can prove safe in Lean
TScert: A Sound Core for TypeScript

TypeScript's checker is deliberately unsound: any, type assertions, unchecked index reads, and covariant arrays let code that passes tsc still read undefined where a type promises string. TScert is an independent checker whose soundness is proved in Lean. It never trusts inferred types; an untrusted producer proposes claims, an untrusted search proposes a certificate, and the proved checker validates it. At v0.94 it verifies 643 of 686 functions in its own tools/ front end, refusing any and type assertions outright.
For every input that meets its annotations, the function's translation into a formal model never applies an operation to a value it does not fit, and never returns a value outside its result type.
- gavinray
> Acceptance proves, of the function's translation into the calculus, that for inputs and a heap meeting their declared types it does not get stuck and does not return a value outside its result type.
TypeScript's type-checker already proves the latter bit, no?
- SSchick
I'd like examples/cases this catches that aren't handled by the existing compiler.
- conartist6
There's there is this little, really piddlingly small problem that TS isn't a sound language. Its type system, for convenience, pretends JS works in ways that are not how JS ACTUALLY works
You can of course slap a formal solver in without knowing that, which is evidently what this person did