Open bjornet opened 3 years ago
Hi @bjornet, I am sorry that you are having this issue. This is a known missing feature that I would like to support at some time. I haven't yet investigated how much time I need to implement this but I think that one of the next versions of the repl extension could support the use strict
mode. So I will mark this as a feature request and I will let you know when it is ready.
Thank you so much for your feedback and feel free to post again if you have any other issues or questions.
Ah i see. Thanks again.
mån 7 juni 2021 kl. 21:34 skrev Achilleas Kiritsakas < @.***>:
Hi @bjornet https://github.com/bjornet, I am sorry that you are having this issue. This is a known missing feature that I would like to support at some time. I haven't yet investigated how much time I need to implement this but I think that one of the next versions of the repl extension could support the use strict mode. So I will mark this as a feature request and I will let you know when it is ready.
Thank you so much for your feedback and feel free to post again if you have any other issues or questions.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/axilleasiv/vscode-javascript-repl-docs/issues/29#issuecomment-856201826, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEMKNI3C7AQUP53V57C3KLTRUNL3ANCNFSM46BS47BQ .
also experiencing this, but in a TS repl
This also happens for me, but I don't even have "use strict"
in the repl file, so I don't know why that directive is even activated...
This is super easy to trip into on a Typescript projects.
Check your tsconfig.json
and see if "compilerOptions.strict": true
is set.
This is super easy to trip into on a Typescript projects.
Check your
tsconfig.json
and see if"compilerOptions.strict": true
is set.
That was what was happening to me; thanks for calling it out! Anyone know of a way to override my tsconfig.json
settings for saved REPL files?
You can keep compilerOptions.strict: true
, you just need to set compilerOptions.alwaysStrict: false
.
But yeah, this should be fixed. Ideally the extension should remove 'use strict' before executing the file internally.
@niieani's suggestion works for me! added to tsconfig.json
in project root directory :
{
"compilerOptions": {
"alwaysStrict": false
}
}
I'm trying to run the REPL with strict mode "use strict" which seems to break the inline evaluation.
How to reproduce
"use strict"
on first lineWhat is expected to happen
What is actually happening
Illegal 'use strict' directive in function with non-simple parameter list
I'm unsure if this is a bug or if it is a lacking feature.. anyways, it would be quite useful to be able to run the REPL in strict mode. Let me know if I misunderstood anything.