@primer/stylelint-config 12.9.0 → 12.9.1
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.
package/package.json
CHANGED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
[
|
|
2
|
+
"--topicTag-borderColor",
|
|
3
|
+
"--highlight-neutral-bgColor",
|
|
4
|
+
"--page-header-bgColor",
|
|
5
|
+
"--diffBlob-addition-fgColor-text",
|
|
6
|
+
"--diffBlob-addition-fgColor-num",
|
|
7
|
+
"--diffBlob-addition-bgColor-num",
|
|
8
|
+
"--diffBlob-addition-bgColor-line",
|
|
9
|
+
"--diffBlob-addition-bgColor-word",
|
|
10
|
+
"--diffBlob-deletion-fgColor-text",
|
|
11
|
+
"--diffBlob-deletion-fgColor-num",
|
|
12
|
+
"--diffBlob-deletion-bgColor-num",
|
|
13
|
+
"--diffBlob-deletion-bgColor-line",
|
|
14
|
+
"--diffBlob-deletion-bgColor-word",
|
|
15
|
+
"--diffBlob-hunk-bgColor-num",
|
|
16
|
+
"--diffBlob-expander-iconColor",
|
|
17
|
+
"--codeMirror-fgColor",
|
|
18
|
+
"--codeMirror-bgColor",
|
|
19
|
+
"--codeMirror-gutters-bgColor",
|
|
20
|
+
"--codeMirror-gutterMarker-fgColor-default",
|
|
21
|
+
"--codeMirror-gutterMarker-fgColor-muted",
|
|
22
|
+
"--codeMirror-lineNumber-fgColor",
|
|
23
|
+
"--codeMirror-cursor-fgColor",
|
|
24
|
+
"--codeMirror-selection-bgColor",
|
|
25
|
+
"--codeMirror-activeline-bgColor",
|
|
26
|
+
"--codeMirror-matchingBracket-fgColor",
|
|
27
|
+
"--codeMirror-lines-bgColor",
|
|
28
|
+
"--codeMirror-syntax-fgColor-comment",
|
|
29
|
+
"--codeMirror-syntax-fgColor-constant",
|
|
30
|
+
"--codeMirror-syntax-fgColor-entity",
|
|
31
|
+
"--codeMirror-syntax-fgColor-keyword",
|
|
32
|
+
"--codeMirror-syntax-fgColor-storage",
|
|
33
|
+
"--codeMirror-syntax-fgColor-string",
|
|
34
|
+
"--codeMirror-syntax-fgColor-support",
|
|
35
|
+
"--codeMirror-syntax-fgColor-variable",
|
|
36
|
+
"--header-fgColor-default",
|
|
37
|
+
"--header-fgColor-logo",
|
|
38
|
+
"--header-bgColor",
|
|
39
|
+
"--header-borderColor-divider",
|
|
40
|
+
"--headerSearch-bgColor",
|
|
41
|
+
"--headerSearch-borderColor",
|
|
42
|
+
"--avatar-bgColor",
|
|
43
|
+
"--avatar-borderColor",
|
|
44
|
+
"--avatar-shadow",
|
|
45
|
+
"--avatarStack-fade-bgColor-default",
|
|
46
|
+
"--avatarStack-fade-bgColor-muted",
|
|
47
|
+
"--control-bgColor-rest",
|
|
48
|
+
"--control-bgColor-hover",
|
|
49
|
+
"--control-bgColor-active",
|
|
50
|
+
"--control-bgColor-disabled",
|
|
51
|
+
"--control-bgColor-selected",
|
|
52
|
+
"--control-fgColor-rest",
|
|
53
|
+
"--control-fgColor-placeholder",
|
|
54
|
+
"--control-fgColor-disabled",
|
|
55
|
+
"--control-borderColor-rest",
|
|
56
|
+
"--control-borderColor-emphasis",
|
|
57
|
+
"--control-borderColor-disabled",
|
|
58
|
+
"--control-borderColor-selected",
|
|
59
|
+
"--control-borderColor-success",
|
|
60
|
+
"--control-borderColor-danger",
|
|
61
|
+
"--control-borderColor-warning",
|
|
62
|
+
"--control-iconColor-rest",
|
|
63
|
+
"--control-transparent-bgColor-rest",
|
|
64
|
+
"--control-transparent-bgColor-hover",
|
|
65
|
+
"--control-transparent-bgColor-active",
|
|
66
|
+
"--control-transparent-bgColor-disabled",
|
|
67
|
+
"--control-transparent-bgColor-selected",
|
|
68
|
+
"--control-transparent-borderColor-rest",
|
|
69
|
+
"--control-transparent-borderColor-hover",
|
|
70
|
+
"--control-transparent-borderColor-active",
|
|
71
|
+
"--control-danger-fgColor-rest",
|
|
72
|
+
"--control-danger-fgColor-hover",
|
|
73
|
+
"--control-danger-bgColor-hover",
|
|
74
|
+
"--control-danger-bgColor-active",
|
|
75
|
+
"--control-checked-bgColor-rest",
|
|
76
|
+
"--control-checked-bgColor-hover",
|
|
77
|
+
"--control-checked-bgColor-active",
|
|
78
|
+
"--control-checked-bgColor-disabled",
|
|
79
|
+
"--control-checked-fgColor-rest",
|
|
80
|
+
"--control-checked-fgColor-disabled",
|
|
81
|
+
"--control-checked-borderColor-rest",
|
|
82
|
+
"--control-checked-borderColor-hover",
|
|
83
|
+
"--control-checked-borderColor-active",
|
|
84
|
+
"--control-checked-borderColor-disabled",
|
|
85
|
+
"--controlTrack-bgColor-rest",
|
|
86
|
+
"--controlTrack-bgColor-hover",
|
|
87
|
+
"--controlTrack-bgColor-active",
|
|
88
|
+
"--controlTrack-bgColor-disabled",
|
|
89
|
+
"--controlTrack-fgColor-rest",
|
|
90
|
+
"--controlTrack-fgColor-disabled",
|
|
91
|
+
"--controlTrack-borderColor-rest",
|
|
92
|
+
"--controlTrack-borderColor-disabled",
|
|
93
|
+
"--controlKnob-bgColor-rest",
|
|
94
|
+
"--controlKnob-bgColor-disabled",
|
|
95
|
+
"--controlKnob-bgColor-checked",
|
|
96
|
+
"--controlKnob-borderColor-rest",
|
|
97
|
+
"--controlKnob-borderColor-disabled",
|
|
98
|
+
"--controlKnob-borderColor-checked",
|
|
99
|
+
"--counter-borderColor",
|
|
100
|
+
"--button-default-fgColor-rest",
|
|
101
|
+
"--button-default-bgColor-rest",
|
|
102
|
+
"--button-default-bgColor-hover",
|
|
103
|
+
"--button-default-bgColor-active",
|
|
104
|
+
"--button-default-bgColor-selected",
|
|
105
|
+
"--button-default-bgColor-disabled",
|
|
106
|
+
"--button-default-borderColor-rest",
|
|
107
|
+
"--button-default-borderColor-hover",
|
|
108
|
+
"--button-default-borderColor-active",
|
|
109
|
+
"--button-default-borderColor-disabled",
|
|
110
|
+
"--button-default-shadow-resting",
|
|
111
|
+
"--button-primary-fgColor-rest",
|
|
112
|
+
"--button-primary-fgColor-disabled",
|
|
113
|
+
"--button-primary-iconColor-rest",
|
|
114
|
+
"--button-primary-bgColor-rest",
|
|
115
|
+
"--button-primary-bgColor-hover",
|
|
116
|
+
"--button-primary-bgColor-active",
|
|
117
|
+
"--button-primary-bgColor-disabled",
|
|
118
|
+
"--button-primary-borderColor-rest",
|
|
119
|
+
"--button-primary-borderColor-hover",
|
|
120
|
+
"--button-primary-borderColor-active",
|
|
121
|
+
"--button-primary-borderColor-disabled",
|
|
122
|
+
"--button-primary-shadow-selected",
|
|
123
|
+
"--button-invisible-fgColor-rest",
|
|
124
|
+
"--button-invisible-fgColor-hover",
|
|
125
|
+
"--button-invisible-fgColor-disabled",
|
|
126
|
+
"--button-invisible-iconColor-rest",
|
|
127
|
+
"--button-invisible-iconColor-hover",
|
|
128
|
+
"--button-invisible-iconColor-disabled",
|
|
129
|
+
"--button-invisible-bgColor-rest",
|
|
130
|
+
"--button-invisible-bgColor-hover",
|
|
131
|
+
"--button-invisible-bgColor-active",
|
|
132
|
+
"--button-invisible-bgColor-disabled",
|
|
133
|
+
"--button-invisible-borderColor-rest",
|
|
134
|
+
"--button-invisible-borderColor-hover",
|
|
135
|
+
"--button-invisible-borderColor-disabled",
|
|
136
|
+
"--button-outline-fgColor-rest",
|
|
137
|
+
"--button-outline-fgColor-hover",
|
|
138
|
+
"--button-outline-fgColor-active",
|
|
139
|
+
"--button-outline-fgColor-disabled",
|
|
140
|
+
"--button-outline-bgColor-rest",
|
|
141
|
+
"--button-outline-bgColor-hover",
|
|
142
|
+
"--button-outline-bgColor-active",
|
|
143
|
+
"--button-outline-bgColor-disabled",
|
|
144
|
+
"--button-outline-borderColor-hover",
|
|
145
|
+
"--button-outline-borderColor-selected",
|
|
146
|
+
"--button-outline-shadow-selected",
|
|
147
|
+
"--button-danger-fgColor-rest",
|
|
148
|
+
"--button-danger-fgColor-hover",
|
|
149
|
+
"--button-danger-fgColor-active",
|
|
150
|
+
"--button-danger-fgColor-disabled",
|
|
151
|
+
"--button-danger-iconColor-rest",
|
|
152
|
+
"--button-danger-iconColor-hover",
|
|
153
|
+
"--button-danger-bgColor-rest",
|
|
154
|
+
"--button-danger-bgColor-hover",
|
|
155
|
+
"--button-danger-bgColor-active",
|
|
156
|
+
"--button-danger-bgColor-disabled",
|
|
157
|
+
"--button-danger-borderColor-rest",
|
|
158
|
+
"--button-danger-borderColor-hover",
|
|
159
|
+
"--button-danger-borderColor-active",
|
|
160
|
+
"--button-danger-shadow-selected",
|
|
161
|
+
"--button-inactive-fgColor-rest",
|
|
162
|
+
"--button-inactive-bgColor-rest",
|
|
163
|
+
"--buttonCounter-default-bgColor-rest",
|
|
164
|
+
"--buttonCounter-invisible-bgColor-rest",
|
|
165
|
+
"--buttonCounter-primary-bgColor-rest",
|
|
166
|
+
"--buttonCounter-outline-bgColor-rest",
|
|
167
|
+
"--buttonCounter-outline-bgColor-hover",
|
|
168
|
+
"--buttonCounter-outline-bgColor-disabled",
|
|
169
|
+
"--buttonCounter-outline-fgColor-rest",
|
|
170
|
+
"--buttonCounter-outline-fgColor-hover",
|
|
171
|
+
"--buttonCounter-outline-fgColor-disabled",
|
|
172
|
+
"--buttonCounter-danger-bgColor-hover",
|
|
173
|
+
"--buttonCounter-danger-bgColor-disabled",
|
|
174
|
+
"--buttonCounter-danger-bgColor-rest",
|
|
175
|
+
"--buttonCounter-danger-fgColor-rest",
|
|
176
|
+
"--buttonCounter-danger-fgColor-hover",
|
|
177
|
+
"--buttonCounter-danger-fgColor-disabled",
|
|
178
|
+
"--focus-outlineColor",
|
|
179
|
+
"--menu-bgColor-active",
|
|
180
|
+
"--overlay-bgColor",
|
|
181
|
+
"--overlay-backdrop-bgColor",
|
|
182
|
+
"--selectMenu-borderColor",
|
|
183
|
+
"--selectMenu-bgColor-active",
|
|
184
|
+
"--sideNav-bgColor-selected",
|
|
185
|
+
"--skeletonLoader-bgColor",
|
|
186
|
+
"--timelineBadge-bgColor",
|
|
187
|
+
"--treeViewItem-leadingVisual-iconColor-rest",
|
|
188
|
+
"--underlineNav-borderColor-active",
|
|
189
|
+
"--underlineNav-borderColor-hover",
|
|
190
|
+
"--underlineNav-iconColor-rest",
|
|
191
|
+
"--fgColor-default",
|
|
192
|
+
"--fgColor-muted",
|
|
193
|
+
"--fgColor-onEmphasis",
|
|
194
|
+
"--fgColor-onInverse",
|
|
195
|
+
"--fgColor-disabled",
|
|
196
|
+
"--fgColor-link",
|
|
197
|
+
"--fgColor-link-onInverse",
|
|
198
|
+
"--fgColor-neutral",
|
|
199
|
+
"--fgColor-neutral-onInverse",
|
|
200
|
+
"--fgColor-accent",
|
|
201
|
+
"--fgColor-accent-onInverse",
|
|
202
|
+
"--fgColor-success",
|
|
203
|
+
"--fgColor-success-onInverse",
|
|
204
|
+
"--fgColor-attention",
|
|
205
|
+
"--fgColor-attention-onInverse",
|
|
206
|
+
"--fgColor-severe",
|
|
207
|
+
"--fgColor-severe-onInverse",
|
|
208
|
+
"--fgColor-danger",
|
|
209
|
+
"--fgColor-danger-onInverse",
|
|
210
|
+
"--fgColor-open",
|
|
211
|
+
"--fgColor-open-onInverse",
|
|
212
|
+
"--fgColor-closed",
|
|
213
|
+
"--fgColor-closed-onInverse",
|
|
214
|
+
"--fgColor-done",
|
|
215
|
+
"--fgColor-done-onInverse",
|
|
216
|
+
"--fgColor-sponsors",
|
|
217
|
+
"--fgColor-sponsors-onInverse",
|
|
218
|
+
"--bgColor-default",
|
|
219
|
+
"--bgColor-muted",
|
|
220
|
+
"--bgColor-inset",
|
|
221
|
+
"--bgColor-emphasis",
|
|
222
|
+
"--bgColor-inverse",
|
|
223
|
+
"--bgColor-disabled",
|
|
224
|
+
"--bgColor-transparent",
|
|
225
|
+
"--bgColor-neutral-muted",
|
|
226
|
+
"--bgColor-neutral-emphasis",
|
|
227
|
+
"--bgColor-accent-muted",
|
|
228
|
+
"--bgColor-accent-emphasis",
|
|
229
|
+
"--bgColor-success-muted",
|
|
230
|
+
"--bgColor-success-emphasis",
|
|
231
|
+
"--bgColor-attention-muted",
|
|
232
|
+
"--bgColor-attention-emphasis",
|
|
233
|
+
"--bgColor-severe-muted",
|
|
234
|
+
"--bgColor-severe-emphasis",
|
|
235
|
+
"--bgColor-danger-muted",
|
|
236
|
+
"--bgColor-danger-emphasis",
|
|
237
|
+
"--bgColor-open-muted",
|
|
238
|
+
"--bgColor-open-emphasis",
|
|
239
|
+
"--bgColor-closed-muted",
|
|
240
|
+
"--bgColor-closed-emphasis",
|
|
241
|
+
"--bgColor-done-muted",
|
|
242
|
+
"--bgColor-done-emphasis",
|
|
243
|
+
"--bgColor-sponsors-muted",
|
|
244
|
+
"--bgColor-sponsors-emphasis",
|
|
245
|
+
"--borderColor-default",
|
|
246
|
+
"--borderColor-muted",
|
|
247
|
+
"--borderColor-emphasis",
|
|
248
|
+
"--borderColor-disabled",
|
|
249
|
+
"--borderColor-transparent",
|
|
250
|
+
"--borderColor-neutral-muted",
|
|
251
|
+
"--borderColor-neutral-emphasis",
|
|
252
|
+
"--borderColor-accent-muted",
|
|
253
|
+
"--borderColor-accent-emphasis",
|
|
254
|
+
"--borderColor-success-muted",
|
|
255
|
+
"--borderColor-success-emphasis",
|
|
256
|
+
"--borderColor-attention-muted",
|
|
257
|
+
"--borderColor-attention-emphasis",
|
|
258
|
+
"--borderColor-severe-muted",
|
|
259
|
+
"--borderColor-severe-emphasis",
|
|
260
|
+
"--borderColor-danger-muted",
|
|
261
|
+
"--borderColor-danger-emphasis",
|
|
262
|
+
"--borderColor-open-muted",
|
|
263
|
+
"--borderColor-open-emphasis",
|
|
264
|
+
"--borderColor-closed-muted",
|
|
265
|
+
"--borderColor-closed-emphasis",
|
|
266
|
+
"--borderColor-done-muted",
|
|
267
|
+
"--borderColor-done-emphasis",
|
|
268
|
+
"--borderColor-sponsors-muted",
|
|
269
|
+
"--borderColor-sponsors-emphasis",
|
|
270
|
+
"--shadow-inset",
|
|
271
|
+
"--shadow-resting-xsmall",
|
|
272
|
+
"--shadow-resting-small",
|
|
273
|
+
"--shadow-resting-medium",
|
|
274
|
+
"--shadow-floating-small",
|
|
275
|
+
"--shadow-floating-medium",
|
|
276
|
+
"--shadow-floating-large",
|
|
277
|
+
"--shadow-floating-xlarge",
|
|
278
|
+
"--outline-focus"
|
|
279
|
+
]
|
|
@@ -6,38 +6,25 @@ const messages = stylelint.utils.ruleMessages(ruleName, {
|
|
|
6
6
|
`Expected a fallback value for CSS variable ${variable}. New color variables fallbacks, check primer.style/primitives to find the correct value`,
|
|
7
7
|
})
|
|
8
8
|
|
|
9
|
-
const fs = require('fs')
|
|
10
|
-
const path = require('path')
|
|
11
|
-
|
|
12
|
-
const jsonFilePath = 'node_modules/@primer/primitives/tokens-next-private/docs/functional/themes/light.json'
|
|
13
|
-
let jsonContent
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
const fileContent = fs.readFileSync(path.resolve(jsonFilePath), 'utf8')
|
|
17
|
-
jsonContent = JSON.parse(fileContent)
|
|
18
|
-
// console.log('JSON content:', jsonContent) // Log to see the content
|
|
19
|
-
} catch (error) {
|
|
20
|
-
// eslint-disable-next-line no-console
|
|
21
|
-
console.error('Error reading JSON file:', error)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
9
|
module.exports = stylelint.createPlugin(ruleName, enabled => {
|
|
10
|
+
const variables = require('./lib/new-color-css-vars-map.json')
|
|
11
|
+
|
|
25
12
|
if (!enabled) {
|
|
26
13
|
return noop
|
|
27
14
|
}
|
|
28
15
|
|
|
29
16
|
return (root, result) => {
|
|
30
|
-
root.walkDecls(
|
|
31
|
-
for (const
|
|
32
|
-
if (
|
|
17
|
+
root.walkDecls(node => {
|
|
18
|
+
for (const variable of variables) {
|
|
19
|
+
if (node.value.includes(`var(${variable})`)) {
|
|
33
20
|
// Check if the declaration uses a CSS variable from the JSON
|
|
34
|
-
const match =
|
|
21
|
+
const match = node.value.match(new RegExp(`var\\(${variable},(.*)\\)`))
|
|
35
22
|
if (!match || match[1].trim() === '') {
|
|
36
23
|
stylelint.utils.report({
|
|
37
24
|
ruleName,
|
|
38
25
|
result,
|
|
39
|
-
node
|
|
40
|
-
message: messages.expectedFallback(
|
|
26
|
+
node,
|
|
27
|
+
message: messages.expectedFallback(variable),
|
|
41
28
|
})
|
|
42
29
|
}
|
|
43
30
|
}
|