-
-
Notifications
You must be signed in to change notification settings - Fork 152
/
.stylelintrc.js
182 lines (170 loc) Β· 4.25 KB
/
.stylelintrc.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
// @ts-check
/**
* @type {import('npm:stylelint').Config}
*/
export default {
extends: "stylelint-config-standard",
plugins: ["./scripts/lint/stylelint-custom/optimized-svgs.js"],
customSyntax: "postcss-less",
rules: {
"catppuccin/optimized-svgs": true,
"selector-class-pattern": null,
"custom-property-pattern": null,
"selector-id-pattern": null,
"rule-empty-line-before": null,
"comment-empty-line-before": null,
"custom-property-empty-line-before": null,
"at-rule-empty-line-before": null,
"declaration-empty-line-before": null,
"property-no-vendor-prefix": null,
"alpha-value-notation": null,
"color-function-notation": null,
"hue-degree-notation": null,
"keyframes-name-pattern": null,
// Needed for Stylus v1.5.35 workaround, see #341
"media-feature-range-notation": "prefix",
// These are not invalid with Less.
"no-invalid-position-at-import-rule": null,
"no-invalid-double-slash-comments": null,
// font-* properties are disallowed anyway.
"font-family-no-missing-generic-family-keyword": null,
"at-rule-disallowed-list": [
["/^font.*/"],
{
/**
* @param {string} atRule
*/
message: (atRule) => `At-rule ${atRule} is not allowed`,
},
],
"property-disallowed-list": [
[
// Disallow setting custom fonts.
"/font.*/",
// Ideally we could disallow these, but CSS continues to be gross.
// "/animation.*/",
// "/transition.*/",
// Prefer `border-color` over `border`, `outline-color` over `outline`, etc.
"border",
"border-top",
"border-right",
"border-bottom",
"border-left",
"outline",
],
{
/**
* @param {string} prop
*/
message: (prop) => {
if (prop.includes("border") || ["outline"].includes(prop)) {
return `Use \`${prop}-color\` instead of \`${prop}\``;
} else {
return `Property \`${prop}\` is not allowed`;
}
},
},
],
"selector-type-no-unknown": null,
"function-no-unknown": [
true,
{
ignoreFunctions: [
// Generated from https://lesscss.org/functions/ via `Array.from(document.querySelectorAll('.section-content h3.docs-heading'), heading => heading.textContent.replace('\n', ''))`.
"%",
"abs",
"acos",
"alpha",
"argb",
"asin",
"atan",
"average",
"blue",
"boolean",
"ceil",
"color",
"contrast",
"convert",
"cos",
"darken",
"data-uri",
"default",
"desaturate",
"difference",
"e",
"each",
"escape",
"exclusion",
"extract",
"fade",
"fadein",
"fadeout",
"floor",
"get-unit",
"green",
"greyscale",
"hardlight",
"hsl",
"hsla",
"hsv",
"hsva",
"hsvhue",
"hsvsaturation",
"hsvvalue",
"hue",
"if",
"image-height",
"image-size",
"image-width",
"iscolor",
"isdefined",
"isem",
"iskeyword",
"isnumber",
"ispercentage",
"ispixel",
"isruleset",
"isstring",
"isunit",
"isurl",
"length",
"lighten",
"lightness",
"luma",
"luminance",
"max",
"min",
"mix",
"mod",
"multiply",
"negation",
"overlay",
"percentage",
"pi",
"pow",
"range",
"red",
"replace",
"rgb",
"rgba",
"round",
"saturate",
"saturation",
"screen",
"shade",
"sin",
"softlight",
"spin",
"sqrt",
"svg-gradient",
"tan",
"tint",
"unit",
],
},
],
"function-name-case": null,
"at-rule-no-vendor-prefix": null,
"no-descending-specificity": null,
},
};