Comment Newline

Inserts a new line above comment tags. When enabled the rule will add a newline even if preserveLine is set to 0. The rule will not inject new lines when the previous expression is determined to already contain a new line.


👎

false

The commentNewline rule is disabled by default. HTML comments will not insert a newline above comments.

.class-0 {
  width: 100%;
  height: 100%;
  /* some comment */
  padding: 1em 3.8em;
  overflow: auto;
}
/* some comment */
.class-1 {
  position: absolute;
  z-index: 100;
  width: 100%;
  height: 100%;
  /* some comment */
  margin: 0;
  /* some comment */
  padding: 1em 3.8em;
  overflow: auto;
  inset: 0;
}
.class-0 {
  width: 100%;
  height: 100%;
  /* some comment */
  padding: 1em 3.8em;
  overflow: auto;
}
/* some comment */
.class-1 {
  position: absolute;
  z-index: 100;
  width: 100%;
  height: 100%;
  /* some comment */
  margin: 0;
  /* some comment */
  padding: 1em 3.8em;
  overflow: auto;
  inset: 0;
}

🙌

true

When the style commentNewline rule is enabled (i.e: true) then newlines will be inserted above the comments. The first comment in the example below will have a newline inserted. The second comment will remain intact as a newline already exists.

.class-0 {
  width: 100%;
  height: 100%;
  /* some comment */
  padding: 1em 3.8em;
  overflow: auto;
}
/* some comment */
.class-1 {
  position: absolute;
  z-index: 100;
  width: 100%;
  height: 100%;
  /* some comment */
  margin: 0;
  /* some comment */
  padding: 1em 3.8em;
  overflow: auto;
  inset: 0;
}
.class-0 {
  width: 100%;
  height: 100%;
  /* some comment */
  padding: 1em 3.8em;
  overflow: auto;
}
/* some comment */
.class-1 {
  position: absolute;
  z-index: 100;
  width: 100%;
  height: 100%;
  /* some comment */
  margin: 0;
  /* some comment */
  padding: 1em 3.8em;
  overflow: auto;
  inset: 0;
}