-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathorder.js
50 lines (40 loc) · 1.26 KB
/
order.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* eslint quote-props: [2, "always", {"keywords": false, "unnecessary": true}] */
// using properties order from "stylelint-config-clean-order" but with different overall order (e.g. mixins, variables etc)
const cleanOrderConfig = require("stylelint-config-clean-order");
const propertiesOrder = cleanOrderConfig.rules["order/properties-order"];
propertiesOrder[1] = {
"severity": "warning",
"unspecified": "bottomAlphabetical",
"emptyLineMinimumPropertyThreshold": 1000,
};
module.exports = {
"plugins": ["stylelint-order"],
"rules": {
// top level order - i.e., @extend before CSS rules etc
"order/order": [
// @extend
{
"type": "at-rule",
"name": "extend",
"hasBlock": false,
},
// Dollar variables (e. g., $variable)
"dollar-variables",
// Custom properties (e. g., --property: 10px;)
"custom-properties",
// @include
{
"type": "at-rule",
"name": "include",
"hasBlock": false,
},
// CSS declarations (e. g., display: block)
"declarations",
// Nested at-rules (e. g., div { @media () {} })
"at-rules",
// Nested rules (e. g., a { span {} })
"rules",
],
"order/properties-order": propertiesOrder,
},
};