-
Notifications
You must be signed in to change notification settings - Fork 5.6k
/
Copy pathstylelint.config.mjs
120 lines (120 loc) · 3.1 KB
/
stylelint.config.mjs
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
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author ThinkGem
*/
export default {
root: true,
plugins: ['stylelint-prettier', 'stylelint-less', '@stylistic/stylelint-plugin'],
extends: ['stylelint-config-standard', 'stylelint-config-standard-less'],
ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'],
overrides: [
{
files: ['*.(html|vue)', '**/*.(html|vue)'],
customSyntax: 'postcss-html',
extends: ['stylelint-config-recommended-vue'],
rules: {
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: ['global', 'deep'],
},
],
'selector-pseudo-element-no-unknown': [
true,
{
ignorePseudoElements: ['v-deep', 'v-global', 'v-slotted'],
},
],
},
},
{
files: ['*.less', '**/*.less'],
customSyntax: 'postcss-less',
extends: ['stylelint-config-recommended-less'],
},
{
files: ['*.scss', '**/*.scss'],
customSyntax: 'postcss-scss',
extends: ['stylelint-config-recommended-scss', 'stylelint-config-recommended-vue/scss'],
},
],
rules: {
'prettier/prettier': [
true,
{
preferPositionShorthand: 'never',
preferOverflowShorthand: 'separate',
},
],
'media-feature-range-notation': null,
'selector-not-notation': null,
'import-notation': null,
'function-no-unknown': null,
'selector-class-pattern': null,
'at-rule-prelude-no-invalid': null,
'declaration-property-value-no-unknown': null,
'declaration-property-value-keyword-no-deprecated': null,
'declaration-property-value-disallowed-list': {
inset: [/.*/], // 禁止所有 inset 属性值
},
// 允许使用传统属性
'declaration-property-value-allowed-list': {
top: [/.*/],
right: [/.*/],
bottom: [/.*/],
left: [/.*/],
},
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: ['global', 'deep'],
},
],
'selector-pseudo-element-no-unknown': [
true,
{
ignorePseudoElements: ['v-deep'],
},
],
'at-rule-no-unknown': [
true,
{
ignoreAtRules: [
'extends',
'ignores',
'include',
'mixin',
'if',
'else',
'media',
'for',
'at-root',
'unocss',
'apply',
'variants',
'responsive',
'screen',
'function',
'each',
'use',
'forward',
'return',
],
},
],
'no-empty-source': null,
'named-grid-areas-no-invalid': null,
'no-descending-specificity': null,
'font-family-no-missing-generic-family-keyword': null,
'media-query-no-invalid': null,
'rule-empty-line-before': [
'always',
{
ignore: ['after-comment', 'first-nested'],
},
],
'unit-no-unknown': [true, { ignoreUnits: ['rpx'] }],
'no-duplicate-selectors': null,
},
};