Number properties can't be unquoted in TypeScript #10123
Labels
lang:typescript
Issues affecting TypeScript-specific constructs (not general JS issues)
locked-due-to-inactivity
Please open a new issue and fill out the template instead of commenting.
type:docs
Issues about adding or improving documentation
Prettier usually removes unnecessary quotes from properties in TypeScript and JavaScript. However, when a numeric property is used in TypeScript, they keep their original quoting.
I tried to see if the quotes make TypeScript behave differently using TypeScript 4.1.3, but it does not.
In the linked playground, the diffence can be observed when toggling the parser between babel and typescript.
Prettier 2.2.1
Playground link
Input:
Output:
Expected behavior:
The text was updated successfully, but these errors were encountered: