Is there a tool for #TypeScript that checks static type assertions similar to the following one?
// %inferred-type: (string | number | boolean)[]
const arr = [1, 'a', true];
I have written such a tool but it’s not ready for public consumption ATM, so such a tool already existing would save me the work of publishing what I have.
My tool is loosely similar to unit test runners such as Mocha—it enables static unit tests, if you will.
@rauschma there's an ESLint plugin that includes twoslash assertions: https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type
https://effectivetypescript.com/2022/05/28/eslint-plugin-expect-type
@JoshuaKGoldberg This looks good!