matype / stylefmt

stylefmt is a tool that automatically formats stylesheets.
Other
2.1k stars 89 forks source link

SCSS empty line before variable #257

Open JoshConley opened 7 years ago

JoshConley commented 7 years ago

I'm looking for support on adding a new line before variables, such as I can currently lint with stylelint:

{
  "plugins": [
    "stylelint-scss"
  ],
  rules: {
    ...
    'scss/dollar-variable-empty-line-before': ['always', {
      except: ['first-nested', 'after-dollar-variable'],
      ignore: ['after-comment']
    }],
    ]
  },
}

When used in conjunction with this rule:

'at-rule-empty-line-before': ['always', {
  except: ['blockless-after-same-name-blockless']
}]

Stylefmt formats it like this, breaking linting:

@import '../../styles/borders';
@import '../../styles/colors';
@import '../../styles/shadows';
$card-padding: 4rem;

Ideal outcome:

@import '../../styles/borders';
@import '../../styles/colors';
@import '../../styles/shadows';

$card-padding: 4rem;