-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathstylelint.config.mjs
More file actions
160 lines (155 loc) · 4.42 KB
/
Copy pathstylelint.config.mjs
File metadata and controls
160 lines (155 loc) · 4.42 KB
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
/** @type {import('stylelint').Config} */
export default {
extends: ["stylelint-config-standard", "stylelint-config-html/svelte"],
plugins: ["stylelint-order", "stylelint-declaration-strict-value"],
ignoreFiles: [
"dist/**",
"build/**",
".svelte-kit/**",
"node_modules/**",
"src-tauri/**",
// Upstream emerald theme routes (v0.5.1) — literal colors until token migration.
"src/routes/palette/**",
"src/routes/overlay/**",
"src/routes/settings/**",
],
rules: {
// Oxfmt owns formatting and blank lines — avoid fighting the formatter.
"at-rule-empty-line-before": null,
"comment-empty-line-before": null,
"custom-property-empty-line-before": null,
"declaration-empty-line-before": null,
"rule-empty-line-before": null,
// macOS / WebKit surfaces (Tauri) still need targeted vendor prefixes.
"property-no-vendor-prefix": [
true,
{
ignoreProperties: [
"appearance",
"backdrop-filter",
"-webkit-backdrop-filter",
"box-orient",
"line-clamp",
"mask-image",
"tap-highlight-color",
"text-size-adjust",
"user-select",
"-webkit-user-select",
"app-region",
],
},
],
"selector-no-vendor-prefix": [
true,
{
ignoreSelectors: ["/-webkit-/"],
},
],
"value-no-vendor-prefix": [
true,
{
ignoreValues: ["box", "inline-box", "vertical"],
},
],
// Allow standard + -webkit-* pairs (e.g. backdrop-filter for WKWebView/Tauri).
"declaration-block-no-duplicate-properties": [
true,
{
ignoreProperties: ["-webkit-backdrop-filter", "-webkit-user-select"],
},
],
// Interactive components intentionally order :hover / :focus-visible for cascade.
"no-descending-specificity": null,
// BEM-style modifiers (e.g. .form-section-title--with-icon) are used in shared form CSS.
"selector-class-pattern": [
"^([a-z][a-z0-9]*)(-[a-z0-9]+)*(--[a-z0-9]+(-[a-z0-9]+)*)?$",
{
message: (selector) => `Expected class selector "${selector}" to be kebab-case or BEM`,
},
],
// Svelte scoped styles
"selector-pseudo-class-no-unknown": [
true,
{
ignorePseudoClasses: ["global", "deep"],
},
],
"order/order": ["custom-properties", "declarations", "at-rules", "rules"],
},
overrides: [
{
// :global() is Svelte-only; plain .css imports must use normal selectors.
files: ["**/*.css"],
rules: {
"selector-pseudo-class-no-unknown": [
true,
{
ignorePseudoClasses: ["deep"],
},
],
},
},
{
files: ["src/lib/styles/tokens.css"],
rules: {
"color-hex-length": null,
"number-max-precision": null,
"font-family-no-missing-generic-family-keyword": null,
"scale-unlimited/declaration-strict-value": null,
},
},
{
files: [
"src/routes/palette/+page.svelte",
"src/routes/overlay/+page.svelte",
"src/routes/settings/+page.svelte",
],
rules: {
// Upstream emerald theme (v0.5.1) — literal palette until token migration.
"scale-unlimited/declaration-strict-value": null,
"declaration-block-single-line-max-declarations": null,
"declaration-property-value-keyword-no-deprecated": null,
},
},
{
files: ["src/**/*.{css,svelte}"],
excludedFiles: [
"src/lib/styles/tokens.css",
"src/routes/palette/+page.svelte",
"src/routes/overlay/+page.svelte",
"src/routes/settings/+page.svelte",
],
rules: {
"scale-unlimited/declaration-strict-value": [
[
"color",
"background-color",
"fill",
"stroke",
"caret-color",
"outline-color",
"text-decoration-color",
"column-rule-color",
"/^border(-.*)?-color$/",
],
{
ignoreValues: [
"transparent",
"currentColor",
"currentcolor",
"inherit",
"initial",
"unset",
"revert",
"revert-layer",
"none",
"/^var\\(--/",
],
disableFix: true,
expandShorthand: false,
},
],
},
},
],
};