@commencis/stylelint-config 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,708 @@
1
+ // src/rules/cssModulesRules.ts
2
+ var cssModulesRules = {
3
+ // Enforce camelCase class names
4
+ "selector-class-pattern": [
5
+ "^[a-z][a-zA-Z0-9]*$",
6
+ { message: "Module class names must be in camelCase." }
7
+ ],
8
+ // Handle CSS Modules specific pseudo-classes
9
+ "selector-pseudo-class-no-unknown": [
10
+ true,
11
+ {
12
+ ignorePseudoClasses: ["global", "local"]
13
+ }
14
+ ]
15
+ };
16
+
17
+ // src/rules/cssRules.ts
18
+ var cssRules = {
19
+ "color-named": "never",
20
+ "no-unknown-animations": true,
21
+ "selector-max-combinators": 4
22
+ };
23
+
24
+ // src/utils/orderRuleCreators.ts
25
+ function createLogicalGroup(groupName, properties, emptyLineBefore = "always") {
26
+ return {
27
+ groupName,
28
+ properties,
29
+ emptyLineBefore,
30
+ noEmptyLineBetween: true,
31
+ order: "flexible"
32
+ };
33
+ }
34
+ function createAtRule(name, hasBlock) {
35
+ return {
36
+ name,
37
+ hasBlock,
38
+ type: "at-rule"
39
+ };
40
+ }
41
+ function createRule(selector) {
42
+ return {
43
+ selector: `&${selector}`,
44
+ type: "rule"
45
+ };
46
+ }
47
+
48
+ // src/rules/orderRules.ts
49
+ var orderRules = {
50
+ "declaration-empty-line-before": null,
51
+ "order/order": [
52
+ "custom-properties",
53
+ "dollar-variables",
54
+ createAtRule("include", false),
55
+ "declarations",
56
+ createRule("::selection"),
57
+ createRule("::backdrop"),
58
+ createRule("::before"),
59
+ createRule("::after"),
60
+ createRule("::marker"),
61
+ createRule("::first-line"),
62
+ createRule("::first-letter"),
63
+ createRule("::cue"),
64
+ createRule("::cue-region"),
65
+ createRule("::placeholder"),
66
+ createRule("::file-selector-button"),
67
+ createRule("::highlight"),
68
+ createRule("::part"),
69
+ createRule("::slotted"),
70
+ createRule(":root"),
71
+ createRule(":lang"),
72
+ createRule(":scope"),
73
+ createRule(":modal"),
74
+ createRule(":past"),
75
+ createRule(":current"),
76
+ createRule(":future"),
77
+ createRule(":where"),
78
+ createRule(":is"),
79
+ createRule(":has"),
80
+ createRule(":not"),
81
+ createRule(":empty"),
82
+ createRule(":target"),
83
+ createRule(":link"),
84
+ createRule(":local-link"),
85
+ createRule(":any-link"),
86
+ createRule(":defined"),
87
+ createRule(":buffering"),
88
+ createRule(":placeholder-shown"),
89
+ createRule(":right"),
90
+ createRule(":left"),
91
+ createRule(":host"),
92
+ createRule(":host-content"),
93
+ createRule(":only-of-type"),
94
+ createRule(":first-of-type"),
95
+ createRule(":nth-of-type"),
96
+ createRule(":last-of-type"),
97
+ createRule(":nth-last-of-type"),
98
+ createRule(":only-child"),
99
+ createRule(":first"),
100
+ createRule(":first-child"),
101
+ createRule(":nth-child"),
102
+ createRule(":last-child"),
103
+ createRule(":nth-last-child"),
104
+ createRule(":default"),
105
+ createRule(":enabled"),
106
+ createRule(":disabled"),
107
+ createRule(":hover"),
108
+ createRule(":focus"),
109
+ createRule(":focus-within"),
110
+ createRule(":focus-visible"),
111
+ createRule(":active"),
112
+ createRule(":checked"),
113
+ createRule(":visited"),
114
+ createRule(":indeterminate"),
115
+ createRule(":in-range"),
116
+ createRule(":out-of-range"),
117
+ createRule(":valid"),
118
+ createRule(":invalid"),
119
+ createRule(":user-valid"),
120
+ createRule(":user-invalid"),
121
+ createRule(":read-only"),
122
+ createRule(":read-write"),
123
+ createRule(":optional"),
124
+ createRule(":required"),
125
+ createRule(":popover-open"),
126
+ createRule(":fullscreen"),
127
+ createRule(":picture-in-picture"),
128
+ createRule(":autofill"),
129
+ "rules",
130
+ createAtRule("include", true),
131
+ "at-rules"
132
+ ],
133
+ "order/properties-order": [
134
+ [
135
+ createLogicalGroup("All", ["all", "page"]),
136
+ createLogicalGroup(
137
+ "Print",
138
+ ["break-before", "break-inside", "break-after", "orphans", "widows"],
139
+ "threshold"
140
+ ),
141
+ createLogicalGroup("Actions", [
142
+ "cursor",
143
+ "pointer-events",
144
+ "touch-action",
145
+ "resize"
146
+ ]),
147
+ createLogicalGroup(
148
+ "User Actions",
149
+ ["user-select", "user-zoom"],
150
+ "threshold"
151
+ ),
152
+ createLogicalGroup("Content", ["content", "quotes"], "threshold"),
153
+ createLogicalGroup(
154
+ "Counter",
155
+ ["counter-increment", "counter-set", "counter-reset"],
156
+ "threshold"
157
+ ),
158
+ createLogicalGroup("List", [
159
+ "list-style",
160
+ "list-style-type",
161
+ "list-style-position",
162
+ "list-style-image"
163
+ ]),
164
+ createLogicalGroup(
165
+ "Marker",
166
+ ["marker", "marker-start", "marker-mid", "marker-end"],
167
+ "threshold"
168
+ ),
169
+ createLogicalGroup("Display", [
170
+ "display",
171
+ "opacity",
172
+ "isolation",
173
+ "visibility",
174
+ "backface-visibility",
175
+ "appearance"
176
+ ]),
177
+ createLogicalGroup(
178
+ "Position",
179
+ [
180
+ "position",
181
+ "float",
182
+ "clear",
183
+ "offset",
184
+ "offset-position",
185
+ "offset-path",
186
+ "offset-distance",
187
+ "offset-rotate",
188
+ "offset-anchor",
189
+ "inset",
190
+ "inset-block",
191
+ "inset-block-start",
192
+ "inset-block-end",
193
+ "inset-inline",
194
+ "inset-inline-start",
195
+ "inset-inline-end",
196
+ "top",
197
+ "right",
198
+ "bottom",
199
+ "left",
200
+ "z-index"
201
+ ],
202
+ "threshold"
203
+ ),
204
+ createLogicalGroup("Outline", [
205
+ "outline",
206
+ "outline-width",
207
+ "outline-style",
208
+ "outline-color",
209
+ "outline-offset"
210
+ ]),
211
+ createLogicalGroup(
212
+ "Shape",
213
+ ["shape-outside", "shape-margin", "shape-image-threshold"],
214
+ "threshold"
215
+ ),
216
+ createLogicalGroup(
217
+ "Mask",
218
+ [
219
+ "mask",
220
+ "mask-border",
221
+ "mask-border-source",
222
+ "mask-border-slice",
223
+ "mask-border-width",
224
+ "mask-border-outset",
225
+ "mask-border-repeat",
226
+ "mask-border-mode",
227
+ "mask-image",
228
+ "mask-clip",
229
+ "mask-origin",
230
+ "mask-type",
231
+ "mask-size",
232
+ "mask-position",
233
+ "mask-repeat",
234
+ "mask-mode",
235
+ "mask-composite"
236
+ ],
237
+ "threshold"
238
+ ),
239
+ createLogicalGroup("Margin", [
240
+ "margin",
241
+ "margin-block",
242
+ "margin-block-start",
243
+ "margin-block-end",
244
+ "margin-inline",
245
+ "margin-inline-start",
246
+ "margin-inline-end",
247
+ "margin-top",
248
+ "margin-right",
249
+ "margin-bottom",
250
+ "margin-left"
251
+ ]),
252
+ createLogicalGroup(
253
+ "Border",
254
+ [
255
+ "border",
256
+ "border-width",
257
+ "border-style",
258
+ "border-color",
259
+ "border-radius",
260
+ "border-start-start-radius",
261
+ "border-start-end-radius",
262
+ "border-end-start-radius",
263
+ "border-end-end-radius",
264
+ "border-block",
265
+ "border-block-width",
266
+ "border-block-style",
267
+ "border-block-color",
268
+ "border-block-start",
269
+ "border-block-start-width",
270
+ "border-block-start-style",
271
+ "border-block-start-color",
272
+ "border-block-end",
273
+ "border-block-end-width",
274
+ "border-block-end-style",
275
+ "border-block-end-color",
276
+ "border-inline",
277
+ "border-inline-width",
278
+ "border-inline-style",
279
+ "border-inline-color",
280
+ "border-inline-start",
281
+ "border-inline-start-width",
282
+ "border-inline-start-style",
283
+ "border-inline-start-color",
284
+ "border-inline-end",
285
+ "border-inline-end-width",
286
+ "border-inline-end-style",
287
+ "border-inline-end-color",
288
+ "border-top",
289
+ "border-top-left-radius",
290
+ "border-top-right-radius",
291
+ "border-top-width",
292
+ "border-top-style",
293
+ "border-top-color",
294
+ "border-right",
295
+ "border-right-width",
296
+ "border-right-style",
297
+ "border-right-color",
298
+ "border-bottom",
299
+ "border-bottom-left-radius",
300
+ "border-bottom-right-radius",
301
+ "border-bottom-width",
302
+ "border-bottom-style",
303
+ "border-bottom-color",
304
+ "border-left",
305
+ "border-left-width",
306
+ "border-left-style",
307
+ "border-left-color",
308
+ "border-image",
309
+ "border-image-source",
310
+ "border-image-slice",
311
+ "border-image-width",
312
+ "border-image-outset",
313
+ "border-image-repeat"
314
+ ],
315
+ "threshold"
316
+ ),
317
+ createLogicalGroup(
318
+ "Box",
319
+ ["box-sizing", "box-decoration-break", "box-shadow"],
320
+ "threshold"
321
+ ),
322
+ createLogicalGroup(
323
+ "Object",
324
+ ["object-fit", "object-position"],
325
+ "threshold"
326
+ ),
327
+ createLogicalGroup(
328
+ "container",
329
+ ["container", "container-name", "container-type"],
330
+ "threshold"
331
+ ),
332
+ createLogicalGroup(
333
+ "Contain",
334
+ [
335
+ "contain",
336
+ "contain-intrinsic-size",
337
+ "contain-intrinsic-block-size",
338
+ "contain-intrinsic-inline-size",
339
+ "contain-intrinsic-height",
340
+ "contain-intrinsic-width"
341
+ ],
342
+ "threshold"
343
+ ),
344
+ createLogicalGroup("Dimensions", [
345
+ "aspect-ratio",
346
+ "block-size",
347
+ "min-block-size",
348
+ "max-block-size",
349
+ "inline-size",
350
+ "min-inline-size",
351
+ "max-inline-size",
352
+ "height",
353
+ "min-height",
354
+ "max-height",
355
+ "width",
356
+ "min-width",
357
+ "max-width"
358
+ ]),
359
+ createLogicalGroup(
360
+ "Padding",
361
+ [
362
+ "padding",
363
+ "padding-block",
364
+ "padding-block-start",
365
+ "padding-block-end",
366
+ "padding-inline",
367
+ "padding-inline-start",
368
+ "padding-inline-end",
369
+ "padding-top",
370
+ "padding-right",
371
+ "padding-bottom",
372
+ "padding-left"
373
+ ],
374
+ "threshold"
375
+ ),
376
+ createLogicalGroup(
377
+ "Overflow",
378
+ [
379
+ "overflow",
380
+ "overflow-clip-margin",
381
+ "overflow-block",
382
+ "overflow-inline",
383
+ "overflow-y",
384
+ "overflow-x",
385
+ "overflow-wrap",
386
+ "overflow-anchor"
387
+ ],
388
+ "threshold"
389
+ ),
390
+ createLogicalGroup(
391
+ "Overscroll",
392
+ [
393
+ "overscroll-behavior",
394
+ "overscroll-behavior-block",
395
+ "overscroll-behavior-inline",
396
+ "overscroll-behavior-y",
397
+ "overscroll-behavior-x"
398
+ ],
399
+ "threshold"
400
+ ),
401
+ createLogicalGroup(
402
+ "Scroll",
403
+ [
404
+ "scroll-margin",
405
+ "scroll-margin-block",
406
+ "scroll-margin-block-start",
407
+ "scroll-margin-block-end",
408
+ "scroll-margin-inline",
409
+ "scroll-margin-inline-start",
410
+ "scroll-margin-inline-end",
411
+ "scroll-margin-top",
412
+ "scroll-margin-right",
413
+ "scroll-margin-bottom",
414
+ "scroll-margin-left",
415
+ "scroll-padding",
416
+ "scroll-padding-block",
417
+ "scroll-padding-block-start",
418
+ "scroll-padding-block-end",
419
+ "scroll-padding-inline",
420
+ "scroll-padding-inline-start",
421
+ "scroll-padding-inline-end",
422
+ "scroll-padding-top",
423
+ "scroll-padding-right",
424
+ "scroll-padding-bottom",
425
+ "scroll-padding-left",
426
+ "scroll-snap-type",
427
+ "scroll-snap-align",
428
+ "scroll-snap-stop",
429
+ "scroll-behavior"
430
+ ],
431
+ "threshold"
432
+ ),
433
+ createLogicalGroup(
434
+ "Scrollbar",
435
+ ["scrollbar-gutter", "scrollbar-width", "scrollbar-color"],
436
+ "threshold"
437
+ ),
438
+ createLogicalGroup(
439
+ "Columns",
440
+ [
441
+ "columns",
442
+ "column-width",
443
+ "column-count",
444
+ "column-fill",
445
+ "column-span",
446
+ "column-rule",
447
+ "column-rule-width",
448
+ "column-rule-style",
449
+ "column-rule-color"
450
+ ],
451
+ "threshold"
452
+ ),
453
+ createLogicalGroup(
454
+ "Grid",
455
+ [
456
+ "grid",
457
+ "grid-area",
458
+ "grid-template",
459
+ "grid-template-areas",
460
+ "grid-template-columns",
461
+ "grid-template-rows",
462
+ "grid-auto-flow",
463
+ "grid-auto-columns",
464
+ "grid-column",
465
+ "grid-column-start",
466
+ "grid-column-end",
467
+ "grid-auto-rows",
468
+ "grid-row",
469
+ "grid-row-start",
470
+ "grid-row-end",
471
+ "gap",
472
+ "column-gap",
473
+ "row-gap"
474
+ ],
475
+ "threshold"
476
+ ),
477
+ createLogicalGroup(
478
+ "Flex",
479
+ [
480
+ "flex",
481
+ "flex-grow",
482
+ "flex-shrink",
483
+ "flex-basis",
484
+ "flex-flow",
485
+ "flex-direction",
486
+ "flex-wrap",
487
+ "order"
488
+ ],
489
+ "threshold"
490
+ ),
491
+ createLogicalGroup(
492
+ "Table",
493
+ [
494
+ "table-layout",
495
+ "border-spacing",
496
+ "border-collapse",
497
+ "empty-cells",
498
+ "vertical-align",
499
+ "caption-side"
500
+ ],
501
+ "threshold"
502
+ ),
503
+ createLogicalGroup(
504
+ "Alignment",
505
+ [
506
+ "place-content",
507
+ "place-items",
508
+ "place-self",
509
+ "align-content",
510
+ "align-items",
511
+ "align-self",
512
+ "justify-content",
513
+ "justify-items",
514
+ "justify-self"
515
+ ],
516
+ "threshold"
517
+ ),
518
+ createLogicalGroup("Image", ["image-orientation", "image-rendering"]),
519
+ createLogicalGroup("Typography", [
520
+ "unicode-bidi",
521
+ "unicode-range",
522
+ "tab-size",
523
+ "direction",
524
+ "writing-mode",
525
+ "white-space",
526
+ "ruby-position",
527
+ "line-break",
528
+ "line-height",
529
+ "word-spacing",
530
+ "word-wrap",
531
+ "word-break",
532
+ "letter-spacing",
533
+ "hyphens",
534
+ "hyphenate-character",
535
+ "hyphenate-limit-chars",
536
+ "hanging-punctuation"
537
+ ]),
538
+ createLogicalGroup(
539
+ "Text",
540
+ [
541
+ "text-overflow",
542
+ "text-rendering",
543
+ "text-indent",
544
+ "text-justify",
545
+ "text-orientation",
546
+ "text-shadow",
547
+ "text-transform",
548
+ "text-anchor",
549
+ "text-wrap",
550
+ "text-align",
551
+ "text-align-last",
552
+ "text-combine-upright",
553
+ "text-decoration",
554
+ "text-decoration-skip-ink",
555
+ "text-decoration-thickness",
556
+ "text-decoration-line",
557
+ "text-decoration-style",
558
+ "text-decoration-color",
559
+ "text-emphasis",
560
+ "text-emphasis-position",
561
+ "text-emphasis-style",
562
+ "text-emphasis-color",
563
+ "text-underline-position",
564
+ "text-underline-offset"
565
+ ],
566
+ "threshold"
567
+ ),
568
+ createLogicalGroup(
569
+ "Font",
570
+ [
571
+ "src",
572
+ "font",
573
+ "font-family",
574
+ "font-size",
575
+ "font-size-adjust",
576
+ "font-weight",
577
+ "font-style",
578
+ "font-display",
579
+ "font-palette",
580
+ "font-kerning",
581
+ "font-stretch",
582
+ "font-optical-sizing",
583
+ "font-language-override",
584
+ "font-feature-settings",
585
+ "font-synthesis",
586
+ "font-synthesis-weight",
587
+ "font-synthesis-style",
588
+ "font-synthesis-small-caps",
589
+ "font-variant",
590
+ "font-variant-position",
591
+ "font-variant-ligatures",
592
+ "font-variant-numeric",
593
+ "font-variant-emoji",
594
+ "font-variant-caps",
595
+ "font-variant-east-asian",
596
+ "font-variant-alternates",
597
+ "font-variation-settings"
598
+ ],
599
+ "threshold"
600
+ ),
601
+ createLogicalGroup("Math", ["math-depth", "math-style"], "threshold"),
602
+ createLogicalGroup("SVG", ["fill", "stroke", "paint-order"], "threshold"),
603
+ createLogicalGroup(
604
+ "Color",
605
+ [
606
+ "color-scheme",
607
+ "accent-color",
608
+ "color",
609
+ "caret-color",
610
+ "forced-color-adjust",
611
+ "print-color-adjust"
612
+ ],
613
+ "threshold"
614
+ ),
615
+ createLogicalGroup("Background", [
616
+ "background",
617
+ "background-image",
618
+ "background-color",
619
+ "background-origin",
620
+ "background-size",
621
+ "background-position",
622
+ "background-position-y",
623
+ "background-position-x",
624
+ "background-repeat",
625
+ "background-attachment",
626
+ "background-clip",
627
+ "background-blend-mode"
628
+ ]),
629
+ createLogicalGroup("Filter", [
630
+ "filter",
631
+ "backdrop-filter",
632
+ "mix-blend-mode",
633
+ "clip-path"
634
+ ]),
635
+ createLogicalGroup("Transform", [
636
+ "transform",
637
+ "transform-origin",
638
+ "transform-box",
639
+ "transform-style",
640
+ "translate",
641
+ "scale",
642
+ "rotate",
643
+ "will-change",
644
+ "perspective",
645
+ "perspective-origin"
646
+ ]),
647
+ createLogicalGroup("Transition", [
648
+ "transition",
649
+ "transition-property",
650
+ "transition-duration",
651
+ "transition-timing-function",
652
+ "transition-delay"
653
+ ]),
654
+ createLogicalGroup("Animation", [
655
+ "animation",
656
+ "animation-name",
657
+ "animation-duration",
658
+ "animation-timing-function",
659
+ "animation-delay",
660
+ "animation-iteration-count",
661
+ "animation-direction",
662
+ "animation-fill-mode",
663
+ "animation-play-state",
664
+ "animation-composition"
665
+ ])
666
+ ],
667
+ {
668
+ unspecified: "bottomAlphabetical",
669
+ emptyLineBeforeUnspecified: "threshold",
670
+ emptyLineMinimumPropertyThreshold: 4
671
+ }
672
+ ]
673
+ };
674
+
675
+ // src/rules/stylisticRules.ts
676
+ var stylisticRules = {
677
+ "@stylistic/string-quotes": "single"
678
+ };
679
+
680
+ // src/configs/css.ts
681
+ var cssConfig = {
682
+ extends: ["stylelint-config-standard", "@stylistic/stylelint-config"],
683
+ plugins: ["stylelint-order"],
684
+ rules: {
685
+ ...cssRules,
686
+ ...orderRules,
687
+ ...stylisticRules
688
+ }
689
+ };
690
+ var css_default = cssConfig;
691
+
692
+ // src/configs/css-modules.ts
693
+ var cssModulesConfig = {
694
+ ...css_default,
695
+ overrides: [
696
+ {
697
+ files: ["**/*.module.css"],
698
+ rules: {
699
+ ...css_default.rules,
700
+ ...cssModulesRules
701
+ }
702
+ }
703
+ ]
704
+ };
705
+ var css_modules_default = cssModulesConfig;
706
+ export {
707
+ css_modules_default as default
708
+ };