Does not support export as "string literal"
#56200
Labels
Fix Available
A PR has been opened for this issue
export as "string literal"
#56200
π Search Terms
"export as", "string literal"
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?ts=5.3.0-dev.20231023#code/MYewdgzgLgBAbgQwDYFcCmMC8MCMBuAKDQA8AHEAJ1gG95l0YEIYAiBMGE8qlmAXzxA
π» Code
π Actual behavior
π Expected behavior
It should compile correctly and emit a parseable
.d.ts
if configured in the project's settings.See plain JavaScript example:
lib.mjs
main.mjs
node main.mjs
Additional information about the issue
This fails the "TypeScript is a superset of JavaScript" assertion in the project's description.
Relevant syntax documentation can be found here:
https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/export#syntax
And in the language specification, 16.2 Modules:
https://tc39.es/ecma262/#prod-ModuleExportName
It seems like an exotic request but has benefits for CSS modules which export classes as named exports.
The text was updated successfully, but these errors were encountered: