Bug Report
🔎 Search Terms
"es2020"
"export as string"
"import as string export as string"
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about "exports"
⏯ Playground Link
Playground link with relevant code
💻 Code
// This typescript code...consta=34;export{aas"hello world"};🙁 Actual behavior
// ...generates this invalid JavaScript code.consta=34;export{aas}from"hello world";;The input was valid JavaScript so I would expect (intuitively) for it to be valid TypeScript. This is currently not the case.
🙂 Expected behavior
// I expected this JavaScript code to be generted:consta=34;export{aas"hello world"};Current behavior in browsers and Node.js works with this syntax!
// But running this in the DevTools or Node.js REPL works just fine.awaitimport("data:text/javascript,"+encodeURIComponent(`const a = 34;export { a as "hello world" };`))

JavaScript seems to allow strings as import/export names:
import{"hello world"asa}from"./hello.js"export{aas"hello world"};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
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