formulahendry / vscode-code-runner

Code Runner for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner
MIT License
2.2k stars 294 forks source link

Possible improvement: I think the TypeScript compiler is using an outdated version of JS #1039

Open coolCucumber-cat opened 1 year ago

coolCucumber-cat commented 1 year ago

Describe the bug I watched the TypeScript Basics video by Fireship and noticed that they showed what happens if you try to use await and don't update the tsconfig.json file to use the latest verison of JavaScript. Assuming, this actually uses TypeScript and this is transpiled from TypeScript, the transpiler is generating some very ugly looking and unreadable code. You can make the update tsconfig so that the property "target" of "compilerOptions" is set to "ESNext". I don't know if this is actually the case, maybe it's for some other reason, but just in case you didn't realise

To Reproduce Steps to reproduce the behavior:

  1. Go to User//.vscode/extensions/formulahendry.code-runner-0.12.0/out/src/codeManager.js
  2. You can see the __awaiter function at the top. Quite similar to https://youtu.be/ahCwqrYpIuM?t=155 but I'm not a TS expert so don't quote me on that
SaptatirthaChoudhury commented 1 year ago

I am very interested in contributing.

Properko commented 11 months ago

You can point the TS_NODE_PROJECT variable in your vscode settings to a "modern" tsconfig

"code-runner.executorMap": {
  "typescript": "TS_NODE_PROJECT=~/stuff/tsconfig.json ts-node"
}