Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuration of noEmptyLineBetween. #25

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

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.

None yet

1 participant