-
Notifications
You must be signed in to change notification settings - Fork 3
/
stylelint.js
54 lines (45 loc) · 1.3 KB
/
stylelint.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
45
46
47
48
49
50
51
52
53
54
const { propertyGroups } = require('stylelint-config-clean-order')
const propertiesOrder = propertyGroups.map((properties) => ({
noEmptyLineBetween: true,
emptyLineBefore: 'never', // Don't add empty lines between order groups.
properties,
}))
module.exports = {
extends: [
'stylelint-config-standard',
'stylelint-config-recommended',
'stylelint-config-clean-order',
'stylelint-prettier/recommended',
],
plugins: ['stylelint-less', 'stylelint-scss', 'stylelint-order'],
rules: {
'prettier/prettier': [true, { severity: 'warning' }],
'order/properties-order': [
propertiesOrder,
{
severity: 'warning',
unspecified: 'bottomAlphabetical',
},
],
'at-rule-no-unknown': [
true,
{
ignoreAtRules: [
// 添加对 tailwind 指令的支持
'tailwind',
'apply',
'variants',
'responsive',
'screen',
'layer',
'import',
// ====================
],
},
],
'color-function-notation': 'modern',
'selector-class-pattern':
'^(?:(?:o|c|u|t|s|is|has|_|js|qa)-)?[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*(?:__[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:--[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:\\[.+\\])?$',
},
ignoreFiles: ['build/**/*.css'],
}