-
Notifications
You must be signed in to change notification settings - Fork 0
/
.stylelintrc.cjs
86 lines (82 loc) · 2.36 KB
/
.stylelintrc.cjs
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
// .stylelintrc.js
module.exports = {
// 注册 stylelint 的 prettier 插件
plugins: ['stylelint-prettier'],
// 继承一系列规则集合
extends: [
// standard 规则集合
'stylelint-config-standard',
// standard 规则集合的 less 版本
'stylelint-config-recommended-less',
// 样式属性顺序规则
'stylelint-config-recess-order',
// 接入 Prettier 规则
'stylelint-config-prettier',
'stylelint-prettier/recommended'
],
// 配置 rules
rules: {
// 开启 Prettier 自动格式化功能
'prettier/prettier': true,
'order/order': ['custom-properties', 'declarations'],
'order/properties-order': [
/* Positioning */
'position',
'top',
'right',
'bottom',
'left',
'z-index',
/* Box Model */ /* white space between groups is ENFORCED */ 'display',
'float',
'width',
'height',
'margin',
'padding',
/* Typography */
'color',
'font',
'line-height',
'text-align',
/* Visual */
'background-color',
'border',
'border-radius',
'opacity',
/* Animation */
'transition'
],
indentation: 2,
'max-nesting-depth': 5,
// 'selector-max-id': [0, { severity: 'warning' }],
'selector-max-attribute': 2,
'selector-max-class': 5,
'selector-max-combinators': 5,
'selector-max-compound-selectors': 5,
'selector-max-type': 2,
'selector-max-universal': [0, { severity: 'warning' }],
'selector-list-comma-newline-after': 'always',
'block-no-empty': true,
'comment-no-empty': true,
'block-opening-brace-space-before': 'always',
'block-opening-brace-space-after': 'always-single-line',
'block-opening-brace-newline-after': 'always-multi-line',
'block-closing-brace-newline-before': 'always-multi-line',
'block-closing-brace-newline-after': 'always',
'declaration-block-semicolon-newline-after': 'always',
'declaration-colon-space-before': 'never',
'declaration-colon-space-after': 'always',
'length-zero-no-unit': true,
'declaration-block-trailing-semicolon': 'always',
'no-extra-semicolons': true,
'declaration-no-important': true,
'selector-class-pattern': null,
'selector-pseudo-class-no-unknown': null
},
overrides: [
{
files: ['**/*.less'],
customSyntax: 'postcss-less'
}
]
};