1
+ // @ts -check
2
+ import { defineConfig } from 'stylelint-define-config' ;
1
3
import { fileURLToPath } from 'node:url' ;
2
4
3
5
const cssVarFiles = [
@@ -6,8 +8,8 @@ const cssVarFiles = [
6
8
fileURLToPath ( new URL ( 'web_src/css/themes/theme-gitea-dark.css' , import . meta. url ) ) ,
7
9
] ;
8
10
9
- /** @type { import('stylelint').Config } */
10
- export default {
11
+ export default defineConfig ( {
12
+ extends : 'stylelint-config-recommended' ,
11
13
plugins : [
12
14
'stylelint-declaration-strict-value' ,
13
15
'stylelint-declaration-block-no-ignored-properties' ,
@@ -67,7 +69,7 @@ export default {
67
69
'@stylistic/function-comma-space-after' : null ,
68
70
'@stylistic/function-comma-space-before' : null ,
69
71
'@stylistic/function-max-empty-lines' : 0 ,
70
- '@stylistic/function-parentheses-newline-inside' : 'never-multi-line' ,
72
+ '@stylistic/function-parentheses-newline-inside' : null ,
71
73
'@stylistic/function-parentheses-space-inside' : null ,
72
74
'@stylistic/function-whitespace-after' : null ,
73
75
'@stylistic/indentation' : 2 ,
@@ -114,134 +116,34 @@ export default {
114
116
'@stylistic/value-list-comma-space-after' : null ,
115
117
'@stylistic/value-list-comma-space-before' : null ,
116
118
'@stylistic/value-list-max-empty-lines' : 0 ,
117
- 'alpha-value-notation' : null ,
118
- 'annotation-no-unknown' : true ,
119
- 'at-rule-allowed-list' : null ,
120
- 'at-rule-disallowed-list' : null ,
121
- 'at-rule-empty-line-before' : null ,
122
119
'at-rule-no-unknown' : [ true , { ignoreAtRules : [ 'tailwind' ] } ] ,
123
120
'at-rule-no-vendor-prefix' : true ,
124
- 'at-rule-property-required-list' : null ,
125
- 'block-no-empty' : true ,
126
- 'color-function-notation' : null ,
127
- 'color-hex-alpha' : null ,
128
- 'color-hex-length' : null ,
129
- 'color-named' : null ,
130
- 'color-no-hex' : null ,
131
- 'color-no-invalid-hex' : true ,
132
- 'comment-empty-line-before' : null ,
133
- 'comment-no-empty' : true ,
134
- 'comment-pattern' : null ,
135
- 'comment-whitespace-inside' : null ,
136
- 'comment-word-disallowed-list' : null ,
137
121
'csstools/value-no-unknown-custom-properties' : [ true , { importFrom : cssVarFiles } ] ,
138
- 'custom-media-pattern' : null ,
139
- 'custom-property-empty-line-before' : null ,
140
- 'custom-property-no-missing-var-function' : true ,
141
- 'custom-property-pattern' : null ,
142
- 'declaration-block-no-duplicate-custom-properties' : true ,
143
122
'declaration-block-no-duplicate-properties' : [ true , { ignore : [ 'consecutive-duplicates-with-different-values' ] } ] ,
144
- 'declaration-block-no-redundant-longhand-properties' : [ true , { ignoreShorthands : [ 'flex-flow' , 'overflow' ] } ] ,
145
- 'declaration-block-no-shorthand-property-overrides' : null ,
146
- 'declaration-block-single-line-max-declarations' : null ,
147
- 'declaration-empty-line-before' : null ,
148
- 'declaration-no-important' : null ,
149
- 'declaration-property-max-values' : null ,
150
- 'declaration-property-unit-allowed-list' : null ,
123
+ 'declaration-block-no-redundant-longhand-properties' : [ true , { ignoreShorthands : [ 'flex-flow' , 'overflow' , 'grid-template' ] } ] ,
124
+ // @ts -expect-error - https://github.com/stylelint-types/stylelint-define-config/issues/1
151
125
'declaration-property-unit-disallowed-list' : { 'line-height' : [ 'em' ] } ,
152
- 'declaration-property-value-allowed-list' : null ,
126
+ // @ts -expect-error - https://github.com/stylelint-types/stylelint-define-config/issues/1
153
127
'declaration-property-value-disallowed-list' : { 'word-break' : [ 'break-word' ] } ,
154
- 'declaration-property-value-no-unknown' : true ,
155
128
'font-family-name-quotes' : 'always-where-recommended' ,
156
- 'font-family-no-duplicate-names' : true ,
157
- 'font-family-no-missing-generic-family-keyword' : true ,
158
- 'font-weight-notation' : null ,
159
- 'function-allowed-list' : null ,
160
- 'function-calc-no-unspaced-operator' : true ,
161
- 'function-disallowed-list' : null ,
162
- 'function-linear-gradient-no-nonstandard-direction' : true ,
163
129
'function-name-case' : 'lower' ,
164
- 'function-no-unknown' : true ,
165
- 'function-url-no-scheme-relative' : null ,
166
130
'function-url-quotes' : 'always' ,
167
- 'function-url-scheme-allowed-list' : null ,
168
- 'function-url-scheme-disallowed-list' : null ,
169
- 'hue-degree-notation' : null ,
170
131
'import-notation' : 'string' ,
171
- 'keyframe-block-no-duplicate-selectors' : true ,
172
- 'keyframe-declaration-no-important' : true ,
173
- 'keyframe-selector-notation' : null ,
174
- 'keyframes-name-pattern' : null ,
175
- 'length-zero-no-unit' : [ true , { ignore : [ 'custom-properties' ] } , { ignoreFunctions : [ 'var' ] } ] ,
176
- 'max-nesting-depth' : null ,
177
- 'media-feature-name-allowed-list' : null ,
178
- 'media-feature-name-disallowed-list' : null ,
179
- 'media-feature-name-no-unknown' : true ,
132
+ 'length-zero-no-unit' : [ true , { ignore : [ 'custom-properties' ] , ignoreFunctions : [ 'var' ] } ] ,
180
133
'media-feature-name-no-vendor-prefix' : true ,
181
- 'media-feature-name-unit-allowed-list' : null ,
182
- 'media-feature-name-value-allowed-list' : null ,
183
- 'media-feature-name-value-no-unknown' : true ,
184
- 'media-feature-range-notation' : null ,
185
- 'media-query-no-invalid' : true ,
186
- 'named-grid-areas-no-invalid' : true ,
187
134
'no-descending-specificity' : null ,
188
- 'no-duplicate-at-import-rules' : true ,
189
- 'no-duplicate-selectors' : true ,
190
- 'no-empty-source' : true ,
191
- 'no-invalid-double-slash-comments' : true ,
192
135
'no-invalid-position-at-import-rule' : [ true , { ignoreAtRules : [ 'tailwind' ] } ] ,
193
- 'no-irregular-whitespace' : true ,
194
136
'no-unknown-animations' : null , // disabled until stylelint supports multi-file linting
195
137
'no-unknown-custom-media' : null , // disabled until stylelint supports multi-file linting
196
138
'no-unknown-custom-properties' : null , // disabled until stylelint supports multi-file linting
197
- 'number-max-precision' : null ,
198
139
'plugin/declaration-block-no-ignored-properties' : true ,
199
- 'property-allowed-list' : null ,
200
- 'property-disallowed-list' : null ,
201
- 'property-no-unknown' : true ,
202
- 'property-no-vendor-prefix' : null ,
203
- 'rule-empty-line-before' : null ,
204
- 'rule-selector-property-disallowed-list' : null ,
205
- 'scale-unlimited/declaration-strict-value' : [ [ '/color$/' , 'font-weight' ] , { ignoreValues : '/^(inherit|transparent|unset|initial|currentcolor|none)$/' , ignoreFunctions : false , disableFix : true , expandShorthand : true } ] ,
206
- 'selector-anb-no-unmatchable' : true ,
207
- 'selector-attribute-name-disallowed-list' : null ,
208
- 'selector-attribute-operator-allowed-list' : null ,
209
- 'selector-attribute-operator-disallowed-list' : null ,
140
+ 'scale-unlimited/declaration-strict-value' : [ [ '/color$/' , 'font-weight' ] , { ignoreValues : '/^(inherit|transparent|unset|initial|currentcolor|none)$/' , ignoreFunctions : true , disableFix : true , expandShorthand : true } ] ,
210
141
'selector-attribute-quotes' : 'always' ,
211
- 'selector-class-pattern' : null ,
212
- 'selector-combinator-allowed-list' : null ,
213
- 'selector-combinator-disallowed-list' : null ,
214
- 'selector-disallowed-list' : null ,
215
- 'selector-id-pattern' : null ,
216
- 'selector-max-attribute' : null ,
217
- 'selector-max-class' : null ,
218
- 'selector-max-combinators' : null ,
219
- 'selector-max-compound-selectors' : null ,
220
- 'selector-max-id' : null ,
221
- 'selector-max-pseudo-class' : null ,
222
- 'selector-max-specificity' : null ,
223
- 'selector-max-type' : null ,
224
- 'selector-max-universal' : null ,
225
- 'selector-nested-pattern' : null ,
226
- 'selector-no-qualifying-type' : null ,
227
142
'selector-no-vendor-prefix' : true ,
228
- 'selector-not-notation' : null ,
229
- 'selector-pseudo-class-allowed-list' : null ,
230
- 'selector-pseudo-class-disallowed-list' : null ,
231
- 'selector-pseudo-class-no-unknown' : true ,
232
- 'selector-pseudo-element-allowed-list' : null ,
233
143
'selector-pseudo-element-colon-notation' : 'double' ,
234
- 'selector-pseudo-element-disallowed-list' : null ,
235
- 'selector-pseudo-element-no-unknown' : true ,
236
144
'selector-type-case' : 'lower' ,
237
145
'selector-type-no-unknown' : [ true , { ignore : [ 'custom-elements' ] } ] ,
238
146
'shorthand-property-no-redundant-values' : true ,
239
- 'string-no-newline' : true ,
240
- 'time-min-milliseconds' : null ,
241
- 'unit-allowed-list' : null ,
242
- 'unit-disallowed-list' : null ,
243
- 'unit-no-unknown' : true ,
244
- 'value-keyword-case' : null ,
245
147
'value-no-vendor-prefix' : [ true , { ignoreValues : [ 'box' , 'inline-box' ] } ] ,
246
148
} ,
247
- } ;
149
+ } ) ;
0 commit comments