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

Typescript does not accept "string name" aliases #56375

Closed
landonxjames opened this issue Nov 13, 2023 · 3 comments · Fixed by #58640
Closed

Typescript does not accept "string name" aliases #56375

landonxjames opened this issue Nov 13, 2023 · 3 comments · Fixed by #58640
Labels
Duplicate An existing issue was already created Fix Available A PR has been opened for this issue

Comments

@landonxjames
Copy link

🔎 Search Terms

export alias string names
import alias string names
string alias for imports/exports

🕗 Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about string names as import/export aliases

⏯ Playground Link

https://www.typescriptlang.org/play?module=1&ssl=3&ssc=17&pln=3&pc=20#code/MYewdgzgLgBAZiEMC8MCMBuAUFgpgDwAcQAnWAbwSQEMIYAiAI2pPoF9sg

💻 Code

const foo = 1;

export {foo as "bar"};

🙁 Actual behavior

This fails to compile because of the as "bar" in the export statement.

🙂 Expected behavior

This should compile and allow string name aliases.

Additional information about the issue

String name import/export aliases should be allowed by the ts compiler. They are valid javascript (see the syntax section of the MDN page in exports).

@fatcerberus
Copy link

Duplicate of #40594

@fatcerberus
Copy link

PR to implement support for this is here #49297 but seems to be stalled.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Nov 13, 2023
@landonxjames
Copy link
Author

Ahh thank you for the pointer! Closing in favor of the existing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants