Typescript’s goal is simply be Javascript + Types.
There are many use cases where one might want to use the excellent typechecker but not really have any emit stage.
Projects already written in javascript work with allowJS. Typescript already supports parsing types from jsdoc comments.
What would be really awesome is just comment annotating your javascript with types and the project gets the benefit of being type checked. This could be a boon for a lot of existing javascript projects. Getting intellisense, VSCode typechecking on the fly and a lot of language server awesomeness.
e.g.
/// <reference path="..." />
class Hello {
/*:: private*/ hello(message /*: string*/) /*: Promise<{}>*/{
const promise /*: Promise<void>*/ = null
return /*:: <Promise<{}>>*/ null;
}
}
i.e
/: [type] */
/:: [tscode] */
Typescript’s goal is simply be Javascript + Types.
There are many use cases where one might want to use the excellent typechecker but not really have any emit stage.
Projects already written in javascript work with allowJS. Typescript already supports parsing types from jsdoc comments.
What would be really awesome is just comment annotating your javascript with types and the project gets the benefit of being type checked. This could be a boon for a lot of existing javascript projects. Getting intellisense, VSCode typechecking on the fly and a lot of language server awesomeness.
e.g.
i.e
/: [type] */
/:: [tscode] */