matype / stylefmt

stylefmt is a tool that automatically formats stylesheets.
Other
2.1k stars 89 forks source link

why stylefmt automatically adds new line after block? #326

Open craigcosmo opened 6 years ago

craigcosmo commented 6 years ago

my stylelint rule in stylelint.rc

{
    "plugins": [
        "stylelint-scss"
    ],
    "rules": {
        "function-calc-no-unspaced-operator":true,
        "function-linear-gradient-no-nonstandard-direction":true,
        "string-no-newline":true,
        "unit-no-unknown":true,
        "property-no-unknown":true,
        "keyframe-declaration-no-important":true,
        "block-no-empty":true,
        "indentation": "tab",
        "selector-pseudo-class-no-unknown":[true, {"ignorePseudoClasses": ["global"]}],
        "selector-pseudo-element-no-unknown":true,
        "selector-type-no-unknown":true,
        "media-feature-name-no-unknown":true,
        "at-rule-no-unknown":true,
        "comment-no-empty":true,
        "color-no-invalid-hex":true,
        "font-family-no-duplicate-names":true,
        "no-empty-source":true,
        "no-extra-semicolons":true,
        "no-unknown-animations":true,
        "declaration-block-no-duplicate-properties": true,
        "no-duplicate-selectors": true
    }
}

When I run stylelint fmt

it turns my original code

    .neo {
        width: 100%;
    }
    .kiu {
        padding-top: 80px;
    }

to this

    .neo {
        width: 100%;
    }

    .kiu {
        padding-top: 80px;
    }

There is a new new after .neo block in the formatted result. Even though I didn't set any rule about new line after block.