🔎 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).
🔎 Search Terms
export alias string names
import alias string names
string alias for imports/exports
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play?module=1&ssl=3&ssc=17&pln=3&pc=20#code/MYewdgzgLgBAZiEMC8MCMBuAUFgpgDwAcQAnWAbwSQEMIYAiAI2pPoF9sg
💻 Code
🙁 Actual behavior
This fails to compile because of the
as "bar"in theexportstatement.🙂 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).