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

It does not add an empty line between groups #133

Open
maksimsemenov opened this issue Jan 8, 2021 · 5 comments
Open

It does not add an empty line between groups #133

maksimsemenov opened this issue Jan 8, 2021 · 5 comments

Comments

@maksimsemenov
Copy link
Contributor

maksimsemenov commented Jan 8, 2021

I'm trying to use order/properties-order rule with emptyLineBefore: 'always', but it does not add an empty line.

Here is the repo with a reproducible example: https://github.com/maksimsemenov/stylelint-order-bug

If you run npx stylelint src/**/* it show an errors, that empty lin is missing. But if you run it with the fix options (npx stylelint --fix src/**/*) it doesn't show any errors, but empty lines are not added as well.

I was trying to debug it, and it seems that addEmptyLineBefore function is called and it changes the node, but these changes are not written to the file. However, the properties for reordered, so it writes some changes to the files, but not the empty line.

@maksimsemenov maksimsemenov changed the title It doe snot add an empty line between groups It does not add an empty line between groups Jan 8, 2021
@hudochenkov
Copy link
Owner

Thanks for providing reproducible example!

declaration-empty-line-before, which is set in stylelint-config-standard removes an empty line. You need to disable this rule.

@maksimsemenov
Copy link
Contributor Author

Ohh, thanks! That makes sense now. Thanks for explaining this.

Will it be helpful to add this into docs? I can work on PR, but just want to check if it is something that is needed

@hudochenkov
Copy link
Owner

Sounds like a good idea.

@RicLeP
Copy link

RicLeP commented Jan 13, 2022

What value is needed for declaration-empty-line-before? I’ve tried lots of values but with no success.

Got it! declaration-empty-line-before: null

@thasmo
Copy link

thasmo commented Feb 12, 2022

I want to use ...

        'declaration-empty-line-before': ['always', {
            except: ['first-nested', 'after-comment', 'after-declaration'],
        }],

... to force an empty line before a block of declarations.

Unfortunately setting this, empty lines between declarations via order/properties-order do not work anymore.

Update: I found this issue describing the problem.

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

No branches or pull requests

4 participants