-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstylelint.config.js
More file actions
71 lines (71 loc) · 1.88 KB
/
stylelint.config.js
File metadata and controls
71 lines (71 loc) · 1.88 KB
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
export default {
extends: [
'stylelint-config-standard-scss',
'stylelint-config-standard-vue/scss',
'stylelint-config-recess-order',
],
plugins: ['@stylistic/stylelint-plugin'],
ignoreFiles: [
'dist/**',
'src/uni_modules/**',
'node_modules/**',
],
rules: {
'@stylistic/indentation': 2,
'@stylistic/block-opening-brace-space-before': 'always',
'@stylistic/block-opening-brace-newline-after': 'always',
'@stylistic/block-closing-brace-empty-line-before': 'never',
'@stylistic/max-empty-lines': 1,
// 禁止空代码
'no-empty-source': null,
// 禁止在覆盖高特异性选择器之后出现低特异性选择器
'no-descending-specificity': null,
// 不允许未知单位
'unit-no-unknown': [true, { ignoreUnits: ['rpx', 'mpx'] }],
// 禁止空注释
'comment-no-empty': true,
// @import 规则必须始终使用字符串表示法。
'import-notation': 'string',
// 未知的 @ 规则
'at-rule-no-unknown': [
true,
{
ignoreAtRules: [
'plugin',
'apply',
'screen',
'function',
'if',
'each',
'include',
'mixin',
'extend',
'content',
'use',
],
},
],
'selector-pseudo-element-no-unknown': [
true,
{
ignorePseudoElements: ['v-deep'],
},
],
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: ['deep'],
},
],
'selector-type-no-unknown': [true, { ignoreTypes: ['page', 'radio', 'checkbox', 'scroll-view'] }],
'at-rule-no-deprecated': null,
'declaration-property-value-no-unknown': null,
'scss/load-partial-extension': null,
'selector-class-pattern': [
'^[a-z0-9-]+(__[a-z0-9-]+)?(--[a-z0-9-]+)?$',
{
message: '类名不符合 BEM 规范',
},
],
},
};