You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now if you set the Playground "Lang" to JavaScript, the right side (output) pane just shows a comment about not needing to compile because the source is JS. Instead, it should default to running tsc --allowJS --emitDeclarationOnly so that we can see the .d.ts file that would be created for the source.
Use Cases
Now that the compiler can be used to create typings based on JSDoc comments in JS code, it would be helpful to have an online sandbox for illustrating how certain JSDoc directives work. For example, if I want to open an issue here about a JSDoc feature misbehaving or some syntax that I'd like to see supported, being able to just put the code up on Playground would make things much easier for everyone involved.
Examples
When I run tsc with the emitDeclarationOnly flag, I get a typings file that I can include when consuming the (JS) code from TS. Playground should generate and show that file.
Search Terms
playground, allowJS, emitDeclarationOnly
Suggestion
Right now if you set the Playground "Lang" to JavaScript, the right side (output) pane just shows a comment about not needing to compile because the source is JS. Instead, it should default to running
tsc --allowJS --emitDeclarationOnly
so that we can see the.d.ts
file that would be created for the source.Use Cases
Now that the compiler can be used to create typings based on JSDoc comments in JS code, it would be helpful to have an online sandbox for illustrating how certain JSDoc directives work. For example, if I want to open an issue here about a JSDoc feature misbehaving or some syntax that I'd like to see supported, being able to just put the code up on Playground would make things much easier for everyone involved.
Examples
When I run
tsc
with theemitDeclarationOnly
flag, I get a typings file that I can include when consuming the (JS) code from TS. Playground should generate and show that file.If implemented we could have a helpful online example of e.g. microsoft/TypeScript#31410, microsoft/TypeScript#30624, etc
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: