Closed hudochenkov closed 7 years ago
@hudochenkov sgtm and the configuration looks pretty simple
That looks excellent for me.
As I've stated in #15 I agree it's becoming a bit of a mess. This solution would definitely work for us as well.
What would the default for emptyLineBefore
be? I assume never
?
Clear and covers the use cases we have 👍🏽✨
What would the default for emptyLineBefore be? I assume never?
By default it won't be set at all.
Thank you for your response! Any idea for a better name?
@hudochenkov maybe declaration-block-properties-order
:smile:
as it's already namespaced by the plugin name, why not just name it "properties-order"?
@evilebottnawi :) I like it, but as I said before, this rule concerned not only about order, but about emptyLineBefore also.
@hudochenkov I think this can be omitted, primary function of this rule is order
Just have released 0.4.0
with properties-order
! Strict order, flexible order, and emptyLineBefore
in one rule :)
Thank you, everyone, for discussion!
The more I think the more I realise that dividing stylelint's
declaration-block-properties-order
into more specific rules creates more confusion then clear state of thing. Rule's tidy couple with each other, share lots of code and big pieces of README.Currently we have:
declaration-block-properties-specified-order
: strict order withunspecified
option. Primary option: array of strings.declaration-block-properties-alphabetical-order
: alphabetical order. Accept onlytrue
.declaration-block-property-groups-structure
: Primary option: array of objects withproperties
andemptyLineBefore
properties. Runsdeclaration-block-properties-specified-order
with properties found in its primary option.declaration-block-properties-flexible-order
(just added): strict order withunspecified
option and support for flexible groups. Primary option: array of strings or objects with propertyproperties
. Properties declared within array follow strict order, while properties within object is in flexible order.declaration-block-properties-specified-order
rule is basically limiteddeclaration-block-properties-flexible-order
rule.declaration-block-property-groups-structure
should support flexible order as well as strict order. So I have to rundeclaration-block-properties-flexible-order
fromdeclaration-block-property-groups-structure
as well asdeclaration-block-properties-specified-order
.See what a mess it became?
declaration-block-properties-alphabetical-order
works great and won't be affected.I was thinking it's better to merge
properties-specified-order
,properties-flexible-order
, andproperty-groups-structure
into one rule. It would be likedeclaration-block-properties-order
in stylelint 6.5.0. Merged rule will support strict order, flexible order, andemptyLineBefore
.Config would be like:
Strict order applies for main array and to objects without
order: "flexible"
.emptyLineBefore
is optional.I think the new rule should have name
declaration-block-properties-structure
. Because it's not about order, but also aboutemptyLineBefore
. I believe there could be a better name, becauseproperties-structure
it's not clear enough./cc @cascornelissen @osk @swernerx @evilebottnawi what do you think about all of this?