matype / stylefmt

stylefmt is a tool that automatically formats stylesheets.
Other
2.1k stars 89 forks source link

Single line formatting #298

Open svipas opened 7 years ago

svipas commented 7 years ago

Hello,

how to make this to NOT format, let it be in 1 line as it is i. e. here:

a { color: #fff; }

What rules do I need configure and HOW? Because I tried everything and still, it formats that code above to:

a {
  color: #fff;
}
kilmc commented 7 years ago

Looking at the Stylelint docs says that the following should work:

{
  "rules": {
    "block-opening-brace-newline-after": "always-multi-line",
    "block-closing-brace-newline-before": "always-multi-line"
  }
}

Here's the quote from the FAQs

To allow single-line blocks but enforce newlines with multi-line blocks, use the "always-multi-line" option for both rules.

Looking at the tests it seems like this might not be what stylefmt is expecting. This might be a bug.