vscode-code-runner icon indicating copy to clipboard operation
vscode-code-runner copied to clipboard

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

Open coolCucumber-cat opened this issue 1 year ago • 2 comments

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

coolCucumber-cat avatar May 02 '23 17:05 coolCucumber-cat

I am very interested in contributing.

SaptatirthaChoudhury avatar May 25 '23 18:05 SaptatirthaChoudhury

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"
}

Properko avatar Nov 24 '23 17:11 Properko