@ramsey @cabbey TypeScript (in the browser, for now) can only be executed after transpiling to JS. Consumers of a TS library need transpiling to use it directly or as a dependency, and types are checked at transpilation time.
Psalm/PHPStan don't require consumers to run them before using/requiring library code. They're dev tools, that's it.
A PHP file format that would need transpiling before being consumed by the engine, and do type check at that transpiling time would be useful.
@ramsey @cabbey It would be really great if transpiling would be self-hosted. Imagine you require a library via Composer. When pulling the code, Composer recognizes it needs transpiling, so it does it and puts the transpiled code in the vendor folder. If transpiling fails, Composer installation fails.
This is not the same of Psalm/PHPStan, even if you could achieve something similar with a Composer plugin that requires the tool and run it on installation.