Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 585 Bytes

File metadata and controls

26 lines (21 loc) · 585 Bytes

Quote and unquote number keys (#8508 by @lydell)

Prettier removes quotes from object keys if they are identifiers. Now, Prettier also removes quotes from object keys that are numbers.

If you use quoteProps: "consistent", Prettier can also add quotes to number keys so that all properties end up with quotes.

// Input
x = {
  "a": null,
  "1": null,
};

// Prettier stable
x = {
  a: null,
  "1": null,
};

// Prettier master
x = {
  a: null,
  1: null,
};