intellij-ideastylingintellij-15

Intellij IDEA, code styling for javascript object, how to remove quotes when not necessary around key?


We would like to edit the javascript code styling in intellij to remove quotes around key within object when not necessary:

{
  "year": 2018,
  "month": 9,
  "day": 24,
  "startHours": 6,
  "startMinutes": 0,
}

should become

{
  year: 2018,
  month: 9,
  day: 24,
  startHours: 6,
  startMinutes: 0,
}

Using CTRL+SHIFT+F (Format code), is this possible ?


Solution

  • I don't think this is possible using Format code. What you can do is Select All (Ctrl/Cmd+A) and then invoke the intention (Alt+ Enter) Unquote property names.