matype / stylefmt

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

comments removed when dealing with multi-line selectors #322

Open vvs opened 7 years ago

vvs commented 7 years ago

Consider the file test.scss:

.sel, // selector #1
.sel2 /* selector #2 */ {
  display: inline;
}

My stylelint rules include: selector-list-comma-newline-after: always. Stylelint produces no errors for such a file, it is OK with the content.

After formatting both comments are gone! :)

.sel,
.sel2 {
  display: inline;
}
montogeek commented 7 years ago

Getting a similar behaviour with this code:

#react-root > section > div, /* Get app banner */
#react-root article img { /* Get app bagde */
  display: none;
}

After running stylefmt, /* Get app banner */ comment is removed