|
1 | 1 | /** |
2 | | - * sass 规范 |
| 2 | + * stylelint 配置 |
3 | 3 | * @author Allenice <994298628@qq.com> |
4 | | - * @since 2017-06-30 05:15:45 |
| 4 | + * @date 2017-07-20 09:57:50 |
5 | 5 | */ |
6 | 6 |
|
7 | | -// 这里 js 使用双引号是因为想可以自由转换成 json |
8 | | - |
9 | 7 | module.exports = { |
10 | | - "ignoreFiles": ["node_modules/**/*.scss"], |
11 | | - "extends": "stylelint-config-standard", |
12 | | - "plugins": ['stylelint-order'], |
13 | | - "rules": { |
14 | | - "color-hex-case": null, |
15 | | - "color-hex-length": null, |
16 | | - "max-empty-lines": 1, |
17 | | - "indentation": 4, |
| 8 | + ignoreFiles: ['node_modules/**/*.scss'], |
| 9 | + extends: 'stylelint-config-standard', |
| 10 | + plugins: ['stylelint-order'], |
| 11 | + rules: { |
| 12 | + 'color-hex-case': 'upper', |
| 13 | + 'color-hex-length': null, |
| 14 | + 'max-empty-lines': 1, |
| 15 | + indentation: 4, |
18 | 16 | // 字符串使用双引号 |
19 | | - "string-quotes": "double", |
| 17 | + 'string-quotes': 'double', |
20 | 18 | // 使用了 autoprefix 不需要前缀 |
21 | | - "property-no-vendor-prefix": true, |
22 | | - "selector-type-no-unknown": null, |
23 | | - "selector-pseudo-element-colon-notation": null, |
24 | | - "selector-pseudo-class-no-unknown": null, |
25 | | - "number-leading-zero": null, |
| 19 | + 'property-no-vendor-prefix': true, |
| 20 | + 'selector-type-no-unknown': null, |
| 21 | + 'selector-pseudo-element-colon-notation': null, |
| 22 | + 'selector-pseudo-class-no-unknown': null, |
| 23 | + 'number-leading-zero': null, |
26 | 24 | // 属性顺序 |
27 | | - "property-no-unknown": [true, { |
28 | | - ignoreProperties: ["composes"] |
29 | | - }], |
| 25 | + 'property-no-unknown': [ |
| 26 | + true, |
| 27 | + { |
| 28 | + ignoreProperties: ['composes'] |
| 29 | + } |
| 30 | + ], |
30 | 31 | // 属性顺序 |
31 | | - "order/order": [ |
32 | | - "dollar-variables", |
33 | | - "custom-properties", |
34 | | - "declarations", |
35 | | - "rules", |
36 | | - "at-rules" |
| 32 | + 'order/order': [ |
| 33 | + 'dollar-variables', |
| 34 | + 'custom-properties', |
| 35 | + 'at-rules', |
| 36 | + 'declarations', |
| 37 | + 'rules' |
37 | 38 | ], |
38 | | - "order/properties-order": [ |
39 | | - "display", |
40 | | - "float", |
41 | | - "position", |
| 39 | + 'order/properties-order': [ |
| 40 | + 'display', |
| 41 | + 'float', |
| 42 | + 'position', |
| 43 | + { |
| 44 | + order: 'flexible', |
| 45 | + properties: ['left', 'top', 'right', 'bottom'] |
| 46 | + }, |
| 47 | + 'width', |
| 48 | + 'height', |
42 | 49 | { |
43 | | - "order": "flexible", |
44 | | - "properties": [ |
45 | | - "left", |
46 | | - "top", |
47 | | - "right", |
48 | | - "bottom", |
| 50 | + order: 'flexible', |
| 51 | + properties: [ |
| 52 | + 'min-width', |
| 53 | + 'max-width', |
| 54 | + 'min-height', |
| 55 | + 'max-height', |
| 56 | + 'line-height' |
49 | 57 | ] |
50 | 58 | }, |
51 | | - "width", |
52 | | - "height", |
53 | | - "min-width", |
54 | | - "min-height", |
55 | | - "padding", |
| 59 | + 'padding', |
56 | 60 | { |
57 | | - "order": "flexible", |
58 | | - "properties": [ |
59 | | - "padding-left", |
60 | | - "padding-top", |
61 | | - "padding-right", |
62 | | - "padding-bottom" |
| 61 | + order: 'flexible', |
| 62 | + properties: [ |
| 63 | + 'padding-left', |
| 64 | + 'padding-top', |
| 65 | + 'padding-right', |
| 66 | + 'padding-bottom' |
63 | 67 | ] |
64 | 68 | }, |
65 | | - "margin", |
| 69 | + 'margin', |
66 | 70 | { |
67 | | - "order": "flexible", |
68 | | - "properties": [ |
69 | | - "margin-left", |
70 | | - "margin-top", |
71 | | - "margin-right", |
72 | | - "margin-bottom" |
| 71 | + order: 'flexible', |
| 72 | + properties: [ |
| 73 | + 'margin-left', |
| 74 | + 'margin-top', |
| 75 | + 'margin-right', |
| 76 | + 'margin-bottom' |
73 | 77 | ] |
74 | 78 | }, |
75 | | - "border", |
| 79 | + 'border', |
76 | 80 | { |
77 | | - "order": "flexible", |
78 | | - "properties": [ |
79 | | - "border-left", |
80 | | - "border-top", |
81 | | - "border-right", |
82 | | - "border-bottom", |
83 | | - "border-radius" |
| 81 | + order: 'flexible', |
| 82 | + properties: [ |
| 83 | + 'border-left', |
| 84 | + 'border-top', |
| 85 | + 'border-right', |
| 86 | + 'border-bottom', |
| 87 | + 'border-radius' |
84 | 88 | ] |
85 | 89 | }, |
86 | | - "background", |
| 90 | + 'background', |
87 | 91 | { |
88 | | - "order": "flexible", |
89 | | - "properties": [ |
90 | | - "background-image", |
91 | | - "background-position", |
92 | | - "background-repeat", |
93 | | - "background-size" |
| 92 | + order: 'flexible', |
| 93 | + properties: [ |
| 94 | + 'background-image', |
| 95 | + 'background-position', |
| 96 | + 'background-repeat', |
| 97 | + 'background-size', |
| 98 | + 'background-color' |
94 | 99 | ] |
95 | 100 | }, |
96 | | - "color", |
97 | | - "font", |
98 | | - "text" |
| 101 | + 'color', |
| 102 | + { |
| 103 | + order: 'flexible', |
| 104 | + properties: ['font-weight', 'font-size'] |
| 105 | + }, |
| 106 | + { |
| 107 | + order: 'flexible', |
| 108 | + properties: ['text-align'] |
| 109 | + } |
99 | 110 | ] |
100 | 111 | } |
101 | 112 | } |
0 commit comments