DonJayamanne / typescript-notebook

Run JavaScript and TypeScript in node.js within VS Code notebooks with excellent support for debugging, tensorflowjs visulizations, plotly, danfojs, etc
https://marketplace.visualstudio.com/items?itemName=donjayamanne.typescript-notebook
MIT License
905 stars 40 forks source link

Support top level awaits #13

Closed DonJayamanne closed 3 years ago

DonJayamanne commented 3 years ago
iwt-twirth commented 3 years ago

Yes please! What would be steps to achieve this?

tslab generally supports top-level await https://github.com/yunabe/tslab/issues/16 (commit)


Edit: I realized, it actually works, but typescript does show errors anyway:

'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module. ts(1375)

Top-level 'await' expressions are only allowed when the 'module' option is set to 'esnext' or 'system', and the 'target' option is set to 'es2017' or higher. ts(1378)
DonJayamanne commented 3 years ago

Done, will be shipped soon

AgainPsychoX commented 2 years ago

Shouldn't it be reopened as warnings still are visible?

image

It works okay, but warnings are very annoying...