-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstylelint.config.js
44 lines (44 loc) · 1.01 KB
/
stylelint.config.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
module.exports = {
root: true,
extends: [
'stylelint-config-standard',
// 规范 css 属性的书写顺序
'stylelint-config-recess-order',
'stylelint-config-recommended-vue',
],
overrides: [
{
// less 的语法解析器
files: '**/*.less',
customSyntax: 'postcss-less',
},
],
rules: {
// 两个空格的缩进
indentation: 2,
'at-rule-no-unknown': [
true,
{
// 解决 scss 中无法识别 @mixin 和 @include 语法的问题
ignoreAtRules: ['mixin', 'extend', 'content', 'include'],
},
],
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: ['deep'],
},
],
// 允许使用 less 的 if 函数
'function-no-unknown': [true, {
ignoreFunctions: ['if'],
}],
// 设置 selector-class-pattern 允许做样式穿透
'selector-class-pattern': [
'^([a-z][a-z0-9]*)((-|__|--)[a-z0-9]+)*$',
{
resolveNestedSelectors: false,
},
],
},
};