Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please warn about javascript es6 modules "export let x = 1" #3733

Closed
lborgman opened this issue Jun 18, 2024 · 1 comment · Fixed by #3928
Closed

Please warn about javascript es6 modules "export let x = 1" #3733

lborgman opened this issue Jun 18, 2024 · 1 comment · Fixed by #3928
Assignees
Labels
C-enhancement Category - New feature or request

Comments

@lborgman
Copy link

I just did

export let x = 1;

and then

const myModule = await import("my-module");
myModule.x = 2;
const myX = myModule.x; // myX will be 1...

The value of myX was a bit unexpected.
Could you please warn about this? (I am using your Visual Studio Code extension. The extension is very nice! <3)

The accepted answer here explains the problem:
https://stackoverflow.com/questions/32558514/javascript-es6-export-const-vs-export-let

@lborgman lborgman added the C-enhancement Category - New feature or request label Jun 18, 2024
@Boshen
Copy link
Member

Boshen commented Jun 18, 2024

Let me test this and turn it on by default, given it's a eslint recommend rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants