microsoft / microsoft/TypeScript
Computed property name is not escaped in declaration emit
Open
@weswigham is already working on this.
Since Jan 2, 2025.
Bug
Domain: Declaration Emit
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
🔎 Search Terms
computed property symbol declaration emit
🕗 Version & Regression Information
- This changed between versions 3.7 and 3.8
⏯ Playground Link
💻 Code
class T {
static readonly ["\t"]: unique symbol;
}
let x = {
[T["\t"]]: 1
};
🙁 Actual behavior
The type of x is emitted as { [T["\t"]]: number; } in declaration files, making the file invalid since the property does not exist on T
🙂 Expected behavior
The escape should be preserved in the property name.
Additional information about the issue
Was introduced by https://github.com/microsoft/TypeScript/pull/18860/commits/8bb7230729f43f1c134f895a535e73c4cd58af3e
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.