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

Get broken result when format condition property. #68

Closed zjffun closed 4 years ago

zjffun commented 4 years ago

Reproduction: https://github.com/zjffun/stylus-supremacy/commit/ef5caf219c248c04737f839f5f1075ae729f58de

Found this by accidentally formatting nib: https://github.com/stylus/nib/blob/master/lib/nib/border-radius.styl#L53

ThisIsManta commented 4 years ago

Would you clarify what the expectation and reality are?

zjffun commented 4 years ago

input:

body
  background #000 unless false
  background #000 if fals

output:

body {
        background: #000;
 unless (false);

        background: #000;
 if (false);
}

then stylus the output

ParseError: input-formatted.styl:19:17
   15|          display: none;
   16|  }
   17|
   18|          background: #000;
   19|  unless (false);
-----------------------^
   20|
   21|          background: #000;
   22|  if (false);
ThisIsManta commented 4 years ago

This will be fixed in v2.14.5. Thanks!