Skip to content

Conversation

@Zielak
Copy link

@Zielak Zielak commented Oct 30, 2019

Added new config option: no-empty-lines-between-properties, which is passed as noEmptyLineBetween to stylelint-order/rules/properties-order for each group.

Why? Because I couldn't achieve the below results with using this plugin and stylelint's declaration-empty-line-before...

If true properties within group should not have empty lines between them.

With both no-empty-lines-between-properties AND empty-line-between-groups set to true, we can have this code to be autofixed to below:

/* Before: note that "boxModel" group has some empty lines between properties */
a {
  position: relative;
  z-index: 10;

  display: block;
  width: auto;
  
  height: auto;

  margin: 10px;

  padding: 10px;

  color: red;

  background: white;
  border: 1px solid blue;
}

/* After: empty lines are only between groups */
a {
  position: relative;
  z-index: 10;

  display: block;
  width: auto;
  height: auto;
  margin: 10px;
  padding: 10px;

  color: red;

  background: white;
  border: 1px solid blue;
}

Also:


If anyone needs it, I published it on npm: @greenly/stylelint-config-rational-order

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant