-
Notifications
You must be signed in to change notification settings - Fork 0
/
stylelint.config.js
218 lines (215 loc) · 7.71 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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
/** @type {import('stylelint').Config} */
export default {
plugins: [
`@stylistic/stylelint-plugin`,
`stylelint-plugin-logical-css`,
`stylelint-gamut`,
],
rules: {
"annotation-no-unknown": true,
"at-rule-empty-line-before": [
`always`,
{
except: [
`first-nested`,
`blockless-after-same-name-blockless`,
],
ignore: [`after-comment`],
},
],
"at-rule-no-unknown": true,
"at-rule-no-vendor-prefix": true,
"block-no-empty": [
true,
{
ignore: [`comments`],
},
],
"color-function-notation": `modern`,
"color-hex-alpha": `never`,
"color-hex-length": `long`,
"color-named": `never`,
"color-no-invalid-hex": true,
"comment-no-empty": true,
"custom-property-no-missing-var-function": true,
"declaration-block-no-duplicate-custom-properties": true,
"declaration-block-no-duplicate-properties": true,
"declaration-block-no-shorthand-property-overrides": true,
"declaration-block-single-line-max-declarations": 0,
"declaration-no-important": true,
"declaration-property-value-disallowed-list": {
display: [
`inline-block`,
`inline-table`,
`inline-flex`,
`inline-grid`,
`inline`,
`block`,
`flex`,
`grid`,
`table`,
`list-item`,
`flow-root`,
],
},
"declaration-property-value-no-unknown": [
true,
// See: https://github.com/stylelint/stylelint/issues/7241
{
typesSyntax: {
color: `| oklch( [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ <hue> | none] [ / [<alpha-value> | none] ]? )`,
},
},
],
"font-family-name-quotes": `always-where-required`,
"font-family-no-duplicate-names": [
true,
{
ignoreFontFamilyNames: [`monospace`],
},
],
"font-family-no-missing-generic-family-keyword": true,
"function-calc-no-unspaced-operator": true,
"function-linear-gradient-no-nonstandard-direction": true,
"function-name-case": `lower`,
"function-no-unknown": true,
"function-url-quotes": `always`,
"import-notation": `string`,
"keyframe-block-no-duplicate-selectors": true,
"keyframe-declaration-no-important": true,
"keyframe-selector-notation": `percentage-unless-within-keyword-only-block`,
"max-nesting-depth": [
2,
{
ignore: [
`blockless-at-rules`,
`pseudo-classes`,
],
},
],
"media-feature-name-no-unknown": true,
"media-feature-name-no-vendor-prefix": true,
"media-query-no-invalid": true,
"named-grid-areas-no-invalid": true,
"no-descending-specificity": true,
"no-duplicate-at-import-rules": true,
"no-duplicate-selectors": true,
"no-empty-source": true,
"no-invalid-double-slash-comments": true,
"no-invalid-position-at-import-rule": true,
"no-irregular-whitespace": true,
"no-unknown-custom-media": true,
"property-no-unknown": [
true,
{
ignoreAtRules: [`font-feature-values`],
},
],
"property-no-vendor-prefix": true,
"rule-empty-line-before": [
`always`,
{
except: [`first-nested`],
ignore: [`after-comment`],
},
],
"selector-anb-no-unmatchable": true,
"selector-attribute-quotes": `always`,
"selector-max-compound-selectors": 2,
"selector-max-id": 0,
"selector-max-universal": 2,
"selector-not-notation": `complex`,
"selector-pseudo-class-no-unknown": true,
"selector-pseudo-element-colon-notation": `double`,
"selector-pseudo-element-no-unknown": true,
"selector-type-case": `lower`,
"selector-type-no-unknown": [
true,
{
ignore: [`custom-elements`],
},
],
"string-no-newline": true,
"unit-no-unknown": true,
"value-keyword-case": `lower`,
"value-no-vendor-prefix": true,
"plugin/use-logical-properties-and-values": true,
"plugin/use-logical-units": true,
"gamut/color-no-out-gamut-range": true,
"@stylistic/at-rule-name-case": `lower`,
"@stylistic/at-rule-name-space-after": `always`,
"@stylistic/at-rule-semicolon-newline-after": `always`,
"@stylistic/block-closing-brace-empty-line-before": `never`,
"@stylistic/block-closing-brace-newline-after": `always`,
"@stylistic/block-closing-brace-newline-before": `always`,
"@stylistic/block-closing-brace-space-after": `always-single-line`,
"@stylistic/block-closing-brace-space-before": `always-single-line`,
"@stylistic/block-opening-brace-newline-after": `always`,
"@stylistic/block-opening-brace-space-after": `always-single-line`,
"@stylistic/block-opening-brace-space-before": `always`,
"@stylistic/color-hex-case": `lower`,
"@stylistic/declaration-bang-space-after": `never`,
"@stylistic/declaration-bang-space-before": `always`,
"@stylistic/declaration-block-semicolon-newline-after": `always`,
"@stylistic/declaration-block-semicolon-newline-before": `never-multi-line`,
"@stylistic/declaration-block-semicolon-space-after": `always-single-line`,
"@stylistic/declaration-block-semicolon-space-before": `never`,
"@stylistic/declaration-block-trailing-semicolon": `always`,
"@stylistic/declaration-colon-newline-after": `always-multi-line`,
"@stylistic/declaration-colon-space-after": `always-single-line`,
"@stylistic/declaration-colon-space-before": `never`,
"@stylistic/function-comma-newline-after": `always-multi-line`,
"@stylistic/function-comma-newline-before": `never-multi-line`,
"@stylistic/function-comma-space-after": `always-single-line`,
"@stylistic/function-comma-space-before": `never`,
"@stylistic/function-max-empty-lines": 0,
"@stylistic/function-parentheses-space-inside": `never-single-line`,
"@stylistic/function-whitespace-after": `always`,
"@stylistic/indentation": `tab`,
"@stylistic/max-empty-lines": 2,
"@stylistic/media-feature-colon-space-after": `always`,
"@stylistic/media-feature-colon-space-before": `never`,
"@stylistic/media-feature-name-case": `lower`,
"@stylistic/media-feature-parentheses-space-inside": `never`,
"@stylistic/media-feature-range-operator-space-after": `always`,
"@stylistic/media-feature-range-operator-space-before": `always`,
"@stylistic/media-query-list-comma-newline-after": `always-multi-line`,
"@stylistic/media-query-list-comma-newline-before": `never-multi-line`,
"@stylistic/media-query-list-comma-space-after": `always-single-line`,
"@stylistic/media-query-list-comma-space-before": `never-single-line`,
"@stylistic/named-grid-areas-alignment": [
true,
{
gap: 2,
alignQuotes: true,
},
],
"@stylistic/no-eol-whitespace": true,
"@stylistic/no-extra-semicolons": true,
"@stylistic/no-missing-end-of-source-newline": true,
"@stylistic/number-leading-zero": `always`,
"@stylistic/number-no-trailing-zeros": true,
"@stylistic/property-case": `lower`,
"@stylistic/selector-attribute-brackets-space-inside": `never`,
"@stylistic/selector-attribute-operator-space-after": `never`,
"@stylistic/selector-attribute-operator-space-before": `never`,
"@stylistic/selector-combinator-space-after": `always`,
"@stylistic/selector-combinator-space-before": `always`,
"@stylistic/selector-descendant-combinator-no-non-space": true,
"@stylistic/selector-list-comma-newline-after": `always`,
"@stylistic/selector-list-comma-newline-before": `never-multi-line`,
"@stylistic/selector-list-comma-space-after": `always-single-line`,
"@stylistic/selector-list-comma-space-before": `never`,
"@stylistic/selector-max-empty-lines": 0,
"@stylistic/selector-pseudo-class-case": `lower`,
"@stylistic/selector-pseudo-class-parentheses-space-inside": `never`,
"@stylistic/selector-pseudo-element-case": `lower`,
"@stylistic/string-quotes": `double`,
"@stylistic/unit-case": `lower`,
"@stylistic/value-list-comma-newline-after": `always-multi-line`,
"@stylistic/value-list-comma-newline-before": `never-multi-line`,
"@stylistic/value-list-comma-space-after": `always-single-line`,
"@stylistic/value-list-comma-space-before": `never`,
"@stylistic/value-list-max-empty-lines": 0,
},
}