-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.stylelintrc.js
120 lines (120 loc) · 3.05 KB
/
.stylelintrc.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// @see: https://stylelint.io
module.exports = {
extends: ["stylelint-config-standard", "stylelint-config-prettier"],
plugins: ["stylelint-order"],
rules: {
"selector-class-pattern": [
// 命名规范 -
"^([a-z][a-z0-9]*)(-[a-z0-9]+)*$",
{
message: "Expected class selector to be kebab-case",
},
],
"string-quotes": "double", // 单引号
"at-rule-empty-line-before": null,
"at-rule-no-unknown": null,
"at-rule-name-case": "lower", // 指定@规则名的大小写
"length-zero-no-unit": true, // 禁止零长度的单位(可自动修复)
"shorthand-property-no-redundant-values": true, // 简写属性
"number-leading-zero": "always", // 小数不带0
"declaration-block-no-duplicate-properties": true, // 禁止声明快重复属性
"no-descending-specificity": true, // 禁止在具有较高优先级的选择器后出现被其覆盖的较低优先级的选择器。
"selector-max-id": null, // 限制一个选择器中 ID 选择器的数量
"max-nesting-depth": 10,
"declaration-block-single-line-max-declarations": 1,
"block-opening-brace-space-before": "always",
"selector-max-type": [0, { ignore: ["child", "descendant", "compounded"] }],
indentation: [
2,
{
// 指定缩进 warning 提醒
severity: "warning",
},
],
"order/order": [
"custom-properties",
"dollar-variables",
"declarations",
"rules",
"at-rules",
],
"order/properties-order": [
// 规则顺序
"position",
"top",
"right",
"bottom",
"left",
"z-index",
"display",
"float",
"width",
"height",
"max-width",
"max-height",
"min-width",
"min-height",
"padding",
"padding-top",
"padding-right",
"padding-bottom",
"padding-left",
"margin",
"margin-top",
"margin-right",
"margin-bottom",
"margin-left",
"margin-collapse",
"margin-top-collapse",
"margin-right-collapse",
"margin-bottom-collapse",
"margin-left-collapse",
"overflow",
"overflow-x",
"overflow-y",
"clip",
"clear",
"font",
"font-family",
"font-size",
"font-smoothing",
"osx-font-smoothing",
"font-style",
"font-weight",
"line-height",
"letter-spacing",
"word-spacing",
"color",
"text-align",
"text-decoration",
"text-indent",
"text-overflow",
"text-rendering",
"text-size-adjust",
"text-shadow",
"text-transform",
"word-break",
"word-wrap",
"white-space",
"vertical-align",
"list-style",
"list-style-type",
"list-style-position",
"list-style-image",
"pointer-events",
"cursor",
"background",
"background-color",
"border",
"border-radius",
"content",
"outline",
"outline-offset",
"opacity",
"filter",
"visibility",
"size",
"transform",
],
},
};