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

Error formatting because of uneven braces #17

Closed LightGlobal closed 6 years ago

LightGlobal commented 6 years ago

sorry, my english is poor

I use vscode plugin vscode-stylus-supremacy to format my css code, but it throw warning unexpected "}"

.modal{
  .modal-img {
    size: 210
  }

  .modal-line
    width: rem(212)
    border: 1px solid #dfdfdf
}

expect format to

.modal{
  .modal-img {
    size: 210
  }

  .modal-line{
    width: rem(212)
    border: 1px solid #dfdfdf
  }
}

my vscode-stylus-supremacy config

{
"[stylus]": {
    "editor.formatOnSave": true
  },
  "languageStylus.useSeparator": true,
  "stylusSupremacy.insertColons": true,
  "stylusSupremacy.insertSemicolons": false,
  "stylusSupremacy.insertBraces": true,
  "stylusSupremacy.insertNewLineAroundImports": true,
  "stylusSupremacy.insertNewLineAroundBlocks": "nested",
  "stylusSupremacy.insertNewLineAroundProperties": false,
  "stylusSupremacy.insertNewLineAroundOthers": false,
  "stylusSupremacy.insertNewLineBetweenSelectors": true,
  "stylusSupremacy.insertSpaceBeforeComment": true,
  "stylusSupremacy.insertSpaceAfterComment": true,
  "stylusSupremacy.insertSpaceAfterComma": true,
  "stylusSupremacy.insertSpaceInsideParenthesis": false,
  "stylusSupremacy.insertParenthesisAfterNegation": false,
  "stylusSupremacy.insertParenthesisAroundIfCondition": true,
  "stylusSupremacy.insertNewLineBeforeElse": false,
  "stylusSupremacy.insertLeadingZeroBeforeFraction": true,
  "stylusSupremacy.quoteChar": "'",
  "stylusSupremacy.sortProperties": false,
  "stylusSupremacy.alwaysUseImport": false,
  "stylusSupremacy.alwaysUseNot": false,
  "stylusSupremacy.alwaysUseAtBlock": false,
  "stylusSupremacy.alwaysUseExtends": false,
  "stylusSupremacy.alwaysUseNoneOverZero": false,
  "stylusSupremacy.alwaysUseZeroWithoutUnit": true,
  "stylusSupremacy.reduceMarginAndPaddingValues": false
}
ThisIsManta commented 6 years ago

In your case, the given code does not even work in http://stylus-lang.com/try.html I believe you should not mix brace-ful grouping with brace-less grouping.