ThisIsManta / stylus-supremacy

A Node.js script that helps formatting Stylus files.
https://thisismanta.github.io/stylus-supremacy
MIT License
88 stars 9 forks source link

Formatting bug remove interpolation braces when inside a function and selectorSeparator is new line #110

Open fabien-michel opened 9 months ago

fabien-michel commented 9 months ago

This very specific condition make formatting remove part of code.

Exemple:

Formatting option: selectorSeparator: "\n"

header-title(n) {
  h{n}
  .h{n} {
    font-family: var(--font-title);

    {block};
  }
}

Format to:

header-title(n) {
  h;

  .h{n} {
    font-family: var(--font-title);

    {block};
  }
}

Note that the braces on the first selector are removed

This does not occur when this code is outside a function:

h{n}
.h{n} {
  font-family: var(--font-title);

  {block};
}