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

question(config): Supermacy options in .stylintrc #34

Closed Kristinita closed 6 years ago

Kristinita commented 6 years ago

1. Summary

I can't find, how I can use Stylus Supermacy options, if I use .stylintrc.

2. Configuration

SashaSupermacy.styl:

.SashaFirst
.SashaSecond {
    color: red
}

supermacy.json:

{
    "stylusSupremacy.selectorSeparator": "\n"
}

.stylintrc:

{
    "blocks": "never",
    "brackets": "never",
    "colons": "never",
    "colors": "always",
    "commaSpace": "always",
    "commentSpace": "always",
    "cssLiteral": "always",
    "depthLimit": 4,
    "duplicates": "always",
    "efficient": "always",
    "exclude": [],
    "extendPref": "@extend",
    "globalDupe": "always",
    "groupOutputByFile": "always",
    "indentPref": false,
    "leadingZero": "never",
    "maxErrors": "never",
    "maxWarnings": "never",
    "mixed": "always",
    "namingConvention": false,
    "namingConventionStrict": "always",
    "none": "never",
    "noImportant": "always",
    "parenSpace": "never",
    "placeholder": "always",
    "prefixVarsWithDollar": "never",
    "quotePref": "double",
    "semicolons": "never",
    "sortOrder": false,
    "stackedProperties": "always",
    "trailingWhitespace": "never",
    "universal": "never",
    "valid": false,
    "zeroUnits": "never",
    "zIndexNormalize": 100
}

3. Expected behavior

I want convent SashaSupermacy.styl to:

.SashaFirst
.SashaSecond
    color red

I hate any extra colons, braces, commas and so on.

4. Actual behavior

If:

stylus-supremacy format SashaSupermacy.styl -r -p supermacy.json
.SashaFirst
.SashaSecond {
    color: red;
}

else:

stylus-supremacy format SashaSupermacy.styl -r -p .stylintrc
.SashaFirst, .SashaSecond
    color red

5. Not helped

  1. Place "stylusSupremacy.selectorSeparator": "\n" or "selectorSeparator": "\n" to .stylintrc.
  2. stylus-supremacy format SashaSupermacy.styl -r -p .stylintrc supermacy.json or stylus-supremacy format SashaSupermacy.styl -r -p .stylintrc -p supermacy.json commands. I get ParseError in terminal.
  3. I can't find equivalent of "stylusSupremacy.selectorSeparator": "\n" in Stylint options.

Thanks.

ThisIsManta commented 6 years ago

Nope, there's no equivalent of selectorSeparator in stylintrc file.

ThisIsManta commented 6 years ago

Closed due to no activities.

Kristinita commented 6 years ago

@ThisIsManta, how I can solved this problem?

Thanks.

ThisIsManta commented 6 years ago

For styling, you either choose to have a JSON file containing formatting options (stylusSupremacy.xxx) or Stylint rules. Unfortunately, you cannot find an equivalent Stylint rule that matches stylusSupremacy.selectorSeparator. Hence, you cannot do it, unless Stylus Supremacy supports reading both formatting options and Stylint rules from the same file.