4 ms·
I do wonder about a future where JavaScript gets non-enforced optional type annotation syntax[1] which is and if said syntax will be slightly incompatible with
by runarberg 5y ago
I do wonder about a future where JavaScript gets non-enforced optional type annotation syntax[1] which is and if said syntax will be slightly incompatible with TypeScript. That would be a little awkward for Deno, wouldn’t it. However I hope that if JS gets type annotation syntax that it would be a strict subset of TypeScript—or at the very least future compatible—for this very reason.
1. https://github.com/giltayar/proposal-types-as-comments https://github.com/giltayar/proposal-types-as-comments
- amitport 5y agoWhatever the final syntax will be, if it is part of the JS standard, Typescript will probably adopt it at some point. (And its team will try to push the standard towards being as close to the current Typescript as possible)
- yesbabyyes 5y agoTypeScript `tsc` can already type check JSDoc type annotations, which is very useful: https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html https://www.typescriptlang.org/docs/handbook/jsdoc-supported... Edit: I should perhaps listen before I speak -- the proposal linked above talks about JSDoc and why it does not fulfill their needs, which may be the case. I have not run in to these limitations myself.