hudochenkov / stylelint-order

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

`emptyLineBefore` for all groups at once #147

Closed robsonsobral closed 3 years ago

robsonsobral commented 3 years ago

Hi! Thank you so much for help me keep tings organized!

Is there a way to enable emptyLineBefore for all groups? I'm using recess, which has many groups, but no line among them.

Thank you so much!

hudochenkov commented 3 years ago

There is not such functionality in stylelint-order. However, you could do it yourself with JavaScript. Since stylelint config could be a JavaScript file, you could modify recess config. Get configuration for properties order rule and add emptyLineBefore to each properties group:

// .stylelintrc.js
const recessConfig = require('stylelint-config-recess-order');

const recessConfigWithEmptyLine = recessConfig.rules['order/properties-order'].map((group) => {
    return {
        ...group,
        emptyLineBefore: 'always',
    }
});

module.exports = {
    extends: ['stylelint-config-recess-order'],
    rules: {
        'order/properties-order': recessConfigWithEmptyLine,
        // your other rules
    }
};