The Wayback Machine - https://web.archive.org/web/20210129131130/https://github.com/microsoft/TypeScript/issues/42476
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

[bug] name is deprecated #42476

Closed
wenfangdu opened this issue Jan 25, 2021 · 6 comments
Closed

[bug] name is deprecated #42476

wenfangdu opened this issue Jan 25, 2021 · 6 comments

Comments

@wenfangdu
Copy link

@wenfangdu wenfangdu commented Jan 25, 2021

💻 Code

image

image

🙂 Expected behavior

No warning.

@AviVahl
Copy link

@AviVahl AviVahl commented Jan 25, 2021

This was an intended change, I believe. See related discussion: #18433

EDIT: Oh. Perhaps this is a legitimate bug because of the destructuring...? Not sure globals should be used/picked up in that location/syntax...

@wenfangdu
Copy link
Author

@wenfangdu wenfangdu commented Jan 25, 2021

@AviVahl It's actually easier to trigger... please see the newly uploaded picture.

@AviVahl
Copy link

@AviVahl AviVahl commented Jan 25, 2021

That's a different behavior, where a .ts file without any esm export/import statements is treated as a script. if you add export {} it would treat it as a module. Not to say that this is ideal behavior or anything.

@DanielRosenwasser
Copy link
Member

@DanielRosenwasser DanielRosenwasser commented Jan 25, 2021

Eventually, I assume we'll be able to look at an .mjs file and say "that's a module", but until then, this is an external behavior.

@wenfangdu
Copy link
Author

@wenfangdu wenfangdu commented Jan 26, 2021

@DanielRosenwasser Just to add more info, .js is the same too:
image

@typescript-bot
Copy link
Collaborator

@typescript-bot typescript-bot commented Jan 28, 2021

This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants