Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 512
Dimitri Kopriwa Avatar asked Oct 15 '25 14:10

Dimitri Kopriwa


1 Answers

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.

like image 118
Bas Leijdekkers Avatar answered Oct 17 '25 16:10

Bas Leijdekkers



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!