hudochenkov / stylelint-order

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

Support Glob or Regex in Properties' Order #190

Closed movahhedi closed 4 weeks ago

movahhedi commented 9 months ago

Hello, Can Glob/Regex/Minimatch support be added for order/properties-order.properties?

Example:

{
    "order/properties-order": [
        [
            {
                "groupName": "all",
                "emptyLineBefore": "threshold",
                "noEmptyLineBetween": true,
                "properties": [
                    "float",
                    "width",
                    "*-width",
                    "height",
                    "*-height",
                    "padding",
                    "padding-*",
                    "margin",
                    "margin-*",
                    "overflow",
                    "overflow-*",
                ]
            }
        ]
    ]
}
hudochenkov commented 9 months ago

It would make order unreliable.

For example, both of these examples would pass linting with your config:

a {
    padding-inline: 10px;
    padding-left: 20px;
    padding-right: 30px;
}

a {
    padding-right: 30px;
    padding-left: 20px;
    padding-inline: 10px;
}
movahhedi commented 4 weeks ago

Some like me just want to group the properties, like margins just to be next to each other.

hudochenkov commented 4 weeks ago

This adds footguns as I showed in previous comment. It's not like it really very helpful. Usually config is done once. And then very rarely new properties added to it. So I see no problem to list properties without globs or regexes.