Repository navigation
Expand file tree
/
Copy pathschema.json
More file actions
323 lines (323 loc) · 9.85 KB
/
Copy pathschema.json
File metadata and controls
323 lines (323 loc) · 9.85 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
{
"$id": "https://unpkg.com/onsystem/schema.json",
"title": "onsystem config",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"$schema": {
"type": "string"
},
"extends": {
"description": "Whether this config builds on the one a design-system package declares (\"onsystem\" in the package.json of a dependency, found from the dependencies): its rules apply over the package's, and, unless it sets components of its own, what it leaves out comes from the package's (components with their importPath, docs, elements, tokens and libraries). Default: true. false reads this config alone.",
"type": "boolean"
},
"components": {
"description": "Globs for component source files, relative to the root.",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"exclude": {
"description": "Globs for files to leave out, relative to the root: `check` in folders and globs, the ESLint plugin, the Claude Code hook and check_ui leave them out, and finding components skips them. A folder (`app/legacy`) covers everything in it. Adds to the defaults (node_modules, .d.ts files, tests and stories); a pattern that starts with `!` takes out the default it names, such as `!**/*.d.ts`.",
"type": "array",
"items": {
"type": "string"
}
},
"tokens": {
"description": "Token files: W3C DTCG JSON (*.json), CSS custom properties (*.css) or a DESIGN.md's front matter (*.md).",
"anyOf": [
{
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "File or glob."
},
"prefix": {
"description": "DTCG only: custom property prefix, e.g. \"acme\" for --acme-color-primary.",
"type": "string"
}
},
"required": [
"path"
],
"additionalProperties": false
}
]
},
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "File or glob."
},
"prefix": {
"description": "DTCG only: custom property prefix, e.g. \"acme\" for --acme-color-primary.",
"type": "string"
}
},
"required": [
"path"
],
"additionalProperties": false
}
]
}
}
]
},
"docs": {
"description": "Globs for per-component Markdown/MDX docs.",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"tsconfig": {
"description": "tsconfig used to resolve types and path aliases.",
"type": "string"
},
"importPath": {
"description": "Package name components are imported from, e.g. \"@acme/ui\", or a pattern for packages imported by path: \"@acme/ui/{path}\" is @acme/ui/primitives/button for primitives/button.tsx in the package. An installed dependency it names exactly, whose component sources the project does not read, is read from its type declarations (.d.ts). Default: inferred from package exports and tsconfig paths.",
"type": "string"
},
"elements": {
"description": "Extra native element → component mappings, e.g. { \"a\": \"Link\" }.",
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
}
},
"libraries": {
"description": "Published component libraries to read from their type declarations when the project depends on them. Omitted: every one onsystem reads (mui). false: none. A list: only those, e.g. [\"mui\"].",
"anyOf": [
{
"type": "boolean",
"const": false
},
{
"type": "array",
"items": {
"type": "string",
"enum": [
"mui"
]
}
}
]
},
"includeDesignSystem": {
"description": "check: lint the design system's own component files too. Off by default: they implement the scale and primitives the rules enforce.",
"type": "boolean"
},
"rules": {
"description": "Rule severities and options: \"off\" | \"warn\" | \"error\" | [severity, { allow }].",
"type": "object",
"propertyNames": {
"type": "string",
"enum": [
"no-hardcoded-color",
"no-hardcoded-spacing",
"no-hardcoded-radius",
"prefer-design-system-component",
"no-unknown-component",
"no-unknown-prop",
"no-unknown-variant",
"icon-button-accessible-name"
]
},
"additionalProperties": {
"anyOf": [
{
"type": "string",
"enum": [
"off",
"warn",
"error"
]
},
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"off",
"warn",
"error"
]
}
],
"additionalItems": false,
"minItems": 1,
"maxItems": 1
},
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"off",
"warn",
"error"
]
},
{
"type": "object",
"properties": {
"allow": {
"description": "Values the rule accepts anyway: colors, lengths, element or component names.",
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
],
"additionalItems": false,
"minItems": 2,
"maxItems": 2
}
]
}
},
"overrides": {
"description": "Rules for some files: [{ \"files\": [\"app/legacy/**\"], \"rules\": { \"no-hardcoded-color\": \"warn\" } }]. Later entries win.",
"type": "array",
"items": {
"type": "object",
"properties": {
"files": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"description": "Globs, relative to the root, of the files these rules apply to: \"app/legacy/**\", \"**/*.generated.tsx\"."
},
"rules": {
"type": "object",
"propertyNames": {
"type": "string",
"enum": [
"no-hardcoded-color",
"no-hardcoded-spacing",
"no-hardcoded-radius",
"prefer-design-system-component",
"no-unknown-component",
"no-unknown-prop",
"no-unknown-variant",
"icon-button-accessible-name"
]
},
"additionalProperties": {
"anyOf": [
{
"type": "string",
"enum": [
"off",
"warn",
"error"
]
},
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"off",
"warn",
"error"
]
}
],
"additionalItems": false,
"minItems": 1,
"maxItems": 1
},
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"off",
"warn",
"error"
]
},
{
"type": "object",
"properties": {
"allow": {
"description": "Values the rule accepts anyway: colors, lengths, element or component names.",
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
],
"additionalItems": false,
"minItems": 2,
"maxItems": 2
}
]
},
"description": "Rule severities and options for those files, over \"rules\"."
}
},
"required": [
"files",
"rules"
],
"additionalProperties": false
}
}
},
"additionalProperties": false
}