export { a as "hello world" }
is valid JavaScript but invalid TypeScript
#54584
Labels
Fix Available
A PR has been opened for this issue
Bug Report
π Search Terms
"es2020"
"export as string"
"import as string export as string"
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
The input was valid JavaScript so I would expect (intuitively) for it to be valid TypeScript. This is currently not the case.
π Expected behavior
Current behavior in browsers and Node.js works with this syntax!
JavaScript seems to allow strings as import/export names:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#syntax
https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/export#syntax
The text was updated successfully, but these errors were encountered: