0

I have css file. I want to set prettier vs code so that after writing a comma, the selector I wrote remained in line with the previous selector. But when i save the file, the selector will be entered to next line

I want to save the code like this (my expectation)

enter image description here

But prettier set the code like this (h3 entered to next line) enter image description here

How to fix this problem? I set trailling comma to none but it doesn't work. enter image description here

doğukan
  • 23,073
  • 13
  • 57
  • 69

1 Answers1

0

I think that config you changed only applies to JavaScript files (notice the reference to ES5).

As far as CSS, prettier is opinionated and they decided that each selector should have its own line (this PR implements that behaviour). I don't think there's a config to change that behaviour.

dialex
  • 2,706
  • 8
  • 44
  • 74