-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add and fix test cases for emptyLineBeforeUnspecified #90
base: master
Are you sure you want to change the base?
Conversation
code: ` | ||
a { | ||
height: 20px; | ||
/* other props */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting this should pass with emptyLineBeforeUnspecified: 'always',
set? I was under the impression this should fail. Anything that isn't a 'height' or 'width' css property should classify as "unspecified" and therefore should have an empty line before it w/ the above config.
That being said, if something isn't a standard css property (e.g. a comment, or the start of a new css selector block), that creates kind of a natural separation.
Let me know what you are thinking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We ignore requirement if there is a comment before. Take a look at these tests for emptyLineBefore
:
stylelint-order/rules/properties-order/tests/empty-line-before.js
Lines 90 to 99 in b003219
{ | |
description: '7', | |
code: ` | |
a { | |
display: none; | |
/* comment */ | |
position: absolute; | |
} | |
`, | |
}, |
stylelint-order/rules/properties-order/tests/empty-line-before.js
Lines 111 to 122 in b003219
{ | |
description: '9', | |
code: ` | |
a { | |
/* comment */ | |
display: none; | |
/* comment */ | |
position: absolute; | |
} | |
`, | |
}, |
They are both accepted when emptyLineBefore: "always"
is set for position
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Word “unspecified” in properties-order
rule always mean properties which are not specified in a config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying, I should have a PR up soon for this then.
Related to #87