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
| module.exports = {
| // 继承推荐规范配置
| extends: [
| 'stylelint-config-standard',
| 'stylelint-config-recommended-scss',
| 'stylelint-config-recommended-vue/scss',
| 'stylelint-config-html/vue',
| 'stylelint-config-recess-order'
| ],
| // 指定不同文件对应的解析器
| overrides: [
| {
| files: ['**/*.{vue,html}'],
| customSyntax: 'postcss-html'
| },
| {
| files: ['**/*.{css,scss}'],
| customSyntax: 'postcss-scss'
| }
| ],
| // 自定义规则
| rules: {
| 'import-notation': 'string', // 指定导入CSS文件的方式("string"|"url")
| 'selector-class-pattern': null, // 选择器类名命名规则
| 'custom-property-pattern': null, // 自定义属性命名规则
| 'keyframes-name-pattern': null, // 动画帧节点样式命名规则
| 'no-descending-specificity': null, // 允许无降序特异性
| 'no-empty-source': null, // 允许空样式
| 'property-no-vendor-prefix': null, // 允许属性前缀
| // 允许 global 、export 、deep伪类
| 'selector-pseudo-class-no-unknown': [
| true,
| {
| ignorePseudoClasses: ['global', 'export', 'deep']
| }
| ],
| // 允许未知属性
| 'property-no-unknown': [
| true,
| {
| ignoreProperties: []
| }
| ],
| // 允许未知规则
| 'at-rule-no-unknown': [
| true,
| {
| ignoreAtRules: [
| 'apply',
| 'use',
| 'mixin',
| 'include',
| 'extend',
| 'each',
| 'if',
| 'else',
| 'for',
| 'while',
| 'reference'
| ]
| }
| ],
| 'scss/at-rule-no-unknown': [
| true,
| {
| ignoreAtRules: [
| 'apply',
| 'use',
| 'mixin',
| 'include',
| 'extend',
| 'each',
| 'if',
| 'else',
| 'for',
| 'while',
| 'reference'
| ]
| }
| ]
| }
| }
|
|