hudochenkov / stylelint-order

A plugin pack of order related linting rules for Stylelint.
MIT License
916 stars 61 forks source link

False negative with `noEmptyLineBetween` in combination with the `order: "flexible"` #82

Closed hudochenkov closed 5 years ago

hudochenkov commented 5 years ago

Thank you for adding the noEmptyLineBetween rule! I immediately added it to our stylelint config, but it seems there is some kind of conflict when you use it in combination with the order: "flexible" rule..:

Config:

[
    {
        emptyLineBefore: "always",
        noEmptyLineBetween: true,
        order: "flexible",
        properties: [
            "height",
            "width",
        ],
    },
    {
        emptyLineBefore: "always",
        noEmptyLineBetween: true,
        order: "flexible",
        properties: [
            "font-size",
            "font-weight",
        ],
    },
]

Example:

a {
    height: 1px;
    width: 2px;

    font-size: 2px;
    font-weight: bold;
}

Result:

 5:5  ✖  Unexpected an empty line before property "font-size"     order/properties-order

After deleting the empty line between width & font-size:

 4:5  ✖  Expected an empty line before property "font-size"       order/properties-order

Originally posted by @dbeerten in https://github.com/hudochenkov/stylelint-order/issues/11#issuecomment-481225683

hudochenkov commented 5 years ago

@dbeerten thank you for reporting! I'll take a look.

hudochenkov commented 5 years ago

Fixed in 2.2.1.

dbeerten commented 5 years ago

Works like a charm now! Thanks @hudochenkov