-
Notifications
You must be signed in to change notification settings - Fork 23
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 package to auto group #265
Comments
At the moment, I do: const recess = require('stylelint-config-recess-order')
//...
'order/properties-order': recess.rules['order/properties-order'].map((group) => ({
...group,
emptyLineBefore: 'always',
noEmptyLineBetween: true,
})),
//... |
I'll look into how I can make this easier in this package 👍 |
Update my config again: module.export = { rules: {
'declaration-empty-line-before': [
'always',
{
except: ['first-nested'],
ignore: ['after-declaration', 'after-comment', 'inside-single-line-block'],
},
],
'order/properties-order': [
recess.rules['order/properties-order'].map((group) => ({
...group,
emptyLineBefore: 'always',
noEmptyLineBetween: true,
})),
{
unspecified: 'bottomAlphabetical',
emptyLineBeforeUnspecified: 'always',
},
],
'order/order': [
[
// Imports
{ type: 'at-rule', name: 'import' },
// Inheritance
{ type: 'at-rule', name: 'extend' },
{ type: 'at-rule', name: 'apply' },
// SCSS Variables
'dollar-variables',
// Declarations
'declarations',
// CSS Variables
'custom-properties',
// Mixins
{ type: 'at-rule', name: 'include' },
{ type: 'at-rule', name: 'mixin' },
{ type: 'at-rule', name: 'add-mixin' },
// Pseudo-elements
{
type: 'rule',
selector: /^&::[\w-]+/,
hasBlock: true,
},
// Nested Rules
'rules',
// Pseudo-classes
{
type: 'rule',
selector: /^&:[\w-]+/,
hasBlock: true,
},
// Nested extending rules
{
type: 'rule',
selector: /^&/,
hasBlock: true,
},
// Media Queries
{ type: 'at-rule', name: 'media', hasBlock: true },
],
{
unspecified: 'bottom',
},
]
} } |
You can also use stylelint-config-clean-order instead of |
@muuvmuuv The latest release adds a new export of the property groups, although it still requires looping through each group object manually I'm afraid. Closing for now, but let me know if this solution doesn't help. |
Would be cool to have a separate package that allows grouping with empty lines.
becomse:
The text was updated successfully, but these errors were encountered: