@enhance-eng/archangel 0.0.1 → 0.1.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/README.md +27 -3
- package/archangel.schema.json +1192 -0
- package/bin/archangel.js +28 -0
- package/index.d.ts +418 -0
- package/index.js +9 -0
- package/lib/platform.js +41 -0
- package/package.json +55 -7
- package/plugin.d.ts +121 -0
- package/plugin.js +8 -0
- package/presets/fsd-conditions.js +360 -0
- package/presets/fsd.js +285 -0
- package/presets/nextjs.js +45 -0
|
@@ -0,0 +1,1192 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "archangel.schema.json",
|
|
4
|
+
"title": "archangel config",
|
|
5
|
+
"description": "The elements of a repository, named sets of its files, and the rules between them. Archangel checks the same fields, with every problem at once.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"elements"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"$schema": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "This schema, for editors; archangel ignores it."
|
|
15
|
+
},
|
|
16
|
+
"elements": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"description": "The elements: parts of the code by file pattern, or packages, by name.",
|
|
19
|
+
"minProperties": 1,
|
|
20
|
+
"additionalProperties": {
|
|
21
|
+
"oneOf": [
|
|
22
|
+
{
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "A path pattern; `{name}` captures one instance, such as one feature."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "array",
|
|
28
|
+
"items": {
|
|
29
|
+
"type": "string"
|
|
30
|
+
},
|
|
31
|
+
"minItems": 1,
|
|
32
|
+
"description": "Several path patterns."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": false,
|
|
37
|
+
"required": [
|
|
38
|
+
"packages"
|
|
39
|
+
],
|
|
40
|
+
"properties": {
|
|
41
|
+
"packages": {
|
|
42
|
+
"type": "array",
|
|
43
|
+
"items": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
},
|
|
46
|
+
"minItems": 1,
|
|
47
|
+
"description": "Package names; a name may end in `*`."
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"selectors": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"description": "Named sets of files, which rules and other selectors use by name. A selector's name may not be an element's.",
|
|
57
|
+
"additionalProperties": {
|
|
58
|
+
"$ref": "#/definitions/selector"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"rules": {
|
|
62
|
+
"type": "array",
|
|
63
|
+
"description": "The rules: a shorthand with `kind`, or a sentence of `files` and one condition.",
|
|
64
|
+
"items": {
|
|
65
|
+
"oneOf": [
|
|
66
|
+
{
|
|
67
|
+
"type": "object",
|
|
68
|
+
"description": "Each listed element may import only itself and later listed elements.",
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"required": [
|
|
71
|
+
"kind",
|
|
72
|
+
"order"
|
|
73
|
+
],
|
|
74
|
+
"properties": {
|
|
75
|
+
"kind": {
|
|
76
|
+
"const": "layers"
|
|
77
|
+
},
|
|
78
|
+
"name": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"description": "The rule's name, for exceptions and the baseline; each rule gives a default."
|
|
81
|
+
},
|
|
82
|
+
"reason": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"description": "Why the rule exists, shown with each violation."
|
|
85
|
+
},
|
|
86
|
+
"link": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "Where to read more, shown with each violation."
|
|
89
|
+
},
|
|
90
|
+
"imports": {
|
|
91
|
+
"enum": [
|
|
92
|
+
"all",
|
|
93
|
+
"runtime",
|
|
94
|
+
"types"
|
|
95
|
+
],
|
|
96
|
+
"description": "Which imports the rule checks: all of them, those that stay at runtime, or type imports."
|
|
97
|
+
},
|
|
98
|
+
"examples": {
|
|
99
|
+
"$ref": "#/definitions/examples"
|
|
100
|
+
},
|
|
101
|
+
"order": {
|
|
102
|
+
"type": "array",
|
|
103
|
+
"items": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"minLength": 1
|
|
106
|
+
},
|
|
107
|
+
"minItems": 1,
|
|
108
|
+
"description": "Each listed element may import only itself and later listed elements."
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"type": "object",
|
|
114
|
+
"description": "The instances of the element may not import each other.",
|
|
115
|
+
"additionalProperties": false,
|
|
116
|
+
"required": [
|
|
117
|
+
"kind",
|
|
118
|
+
"element"
|
|
119
|
+
],
|
|
120
|
+
"properties": {
|
|
121
|
+
"kind": {
|
|
122
|
+
"const": "isolate"
|
|
123
|
+
},
|
|
124
|
+
"name": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"description": "The rule's name, for exceptions and the baseline; each rule gives a default."
|
|
127
|
+
},
|
|
128
|
+
"reason": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"description": "Why the rule exists, shown with each violation."
|
|
131
|
+
},
|
|
132
|
+
"link": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"description": "Where to read more, shown with each violation."
|
|
135
|
+
},
|
|
136
|
+
"imports": {
|
|
137
|
+
"enum": [
|
|
138
|
+
"all",
|
|
139
|
+
"runtime",
|
|
140
|
+
"types"
|
|
141
|
+
],
|
|
142
|
+
"description": "Which imports the rule checks: all of them, those that stay at runtime, or type imports."
|
|
143
|
+
},
|
|
144
|
+
"examples": {
|
|
145
|
+
"$ref": "#/definitions/examples"
|
|
146
|
+
},
|
|
147
|
+
"element": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"minLength": 1,
|
|
150
|
+
"description": "An element whose pattern has a capture, such as `{feature}`."
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"type": "object",
|
|
156
|
+
"description": "Code outside an instance of the element may import it only through these files.",
|
|
157
|
+
"additionalProperties": false,
|
|
158
|
+
"required": [
|
|
159
|
+
"kind",
|
|
160
|
+
"element",
|
|
161
|
+
"files"
|
|
162
|
+
],
|
|
163
|
+
"properties": {
|
|
164
|
+
"kind": {
|
|
165
|
+
"const": "entry"
|
|
166
|
+
},
|
|
167
|
+
"name": {
|
|
168
|
+
"type": "string",
|
|
169
|
+
"description": "The rule's name, for exceptions and the baseline; each rule gives a default."
|
|
170
|
+
},
|
|
171
|
+
"reason": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"description": "Why the rule exists, shown with each violation."
|
|
174
|
+
},
|
|
175
|
+
"link": {
|
|
176
|
+
"type": "string",
|
|
177
|
+
"description": "Where to read more, shown with each violation."
|
|
178
|
+
},
|
|
179
|
+
"imports": {
|
|
180
|
+
"enum": [
|
|
181
|
+
"all",
|
|
182
|
+
"runtime",
|
|
183
|
+
"types"
|
|
184
|
+
],
|
|
185
|
+
"description": "Which imports the rule checks: all of them, those that stay at runtime, or type imports."
|
|
186
|
+
},
|
|
187
|
+
"examples": {
|
|
188
|
+
"$ref": "#/definitions/examples"
|
|
189
|
+
},
|
|
190
|
+
"element": {
|
|
191
|
+
"type": "string",
|
|
192
|
+
"minLength": 1,
|
|
193
|
+
"description": "An element of files."
|
|
194
|
+
},
|
|
195
|
+
"files": {
|
|
196
|
+
"type": "array",
|
|
197
|
+
"items": {
|
|
198
|
+
"type": "string",
|
|
199
|
+
"minLength": 1
|
|
200
|
+
},
|
|
201
|
+
"minItems": 1,
|
|
202
|
+
"description": "The entry files, relative to each instance's folder."
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"type": "object",
|
|
208
|
+
"description": "The files may not import the other side.",
|
|
209
|
+
"additionalProperties": false,
|
|
210
|
+
"required": [
|
|
211
|
+
"files",
|
|
212
|
+
"mayNotImport"
|
|
213
|
+
],
|
|
214
|
+
"properties": {
|
|
215
|
+
"files": {
|
|
216
|
+
"$ref": "#/definitions/selector",
|
|
217
|
+
"description": "The files the rule is about."
|
|
218
|
+
},
|
|
219
|
+
"name": {
|
|
220
|
+
"type": "string",
|
|
221
|
+
"description": "The rule's name, for exceptions and the baseline; each rule gives a default."
|
|
222
|
+
},
|
|
223
|
+
"reason": {
|
|
224
|
+
"type": "string",
|
|
225
|
+
"description": "Why the rule exists, shown with each violation."
|
|
226
|
+
},
|
|
227
|
+
"link": {
|
|
228
|
+
"type": "string",
|
|
229
|
+
"description": "Where to read more, shown with each violation."
|
|
230
|
+
},
|
|
231
|
+
"imports": {
|
|
232
|
+
"enum": [
|
|
233
|
+
"all",
|
|
234
|
+
"runtime",
|
|
235
|
+
"types"
|
|
236
|
+
],
|
|
237
|
+
"description": "Which imports the rule checks: all of them, those that stay at runtime, or type imports."
|
|
238
|
+
},
|
|
239
|
+
"examples": {
|
|
240
|
+
"$ref": "#/definitions/examples"
|
|
241
|
+
},
|
|
242
|
+
"mayNotImport": {
|
|
243
|
+
"$ref": "#/definitions/side",
|
|
244
|
+
"description": "What the files may not import."
|
|
245
|
+
},
|
|
246
|
+
"names": {
|
|
247
|
+
"type": "array",
|
|
248
|
+
"items": {
|
|
249
|
+
"type": "string",
|
|
250
|
+
"minLength": 1
|
|
251
|
+
},
|
|
252
|
+
"minItems": 1,
|
|
253
|
+
"description": "Only imports of these names."
|
|
254
|
+
},
|
|
255
|
+
"specifier": {
|
|
256
|
+
"enum": [
|
|
257
|
+
"relative",
|
|
258
|
+
"parent",
|
|
259
|
+
"alias",
|
|
260
|
+
"package"
|
|
261
|
+
],
|
|
262
|
+
"description": "Only imports written this way: `relative` starts with `./` or `../`, `parent` with `../`, `alias` goes through a tsconfig path or a package `imports` field, and `package` names a package."
|
|
263
|
+
},
|
|
264
|
+
"instance": {
|
|
265
|
+
"enum": [
|
|
266
|
+
"same",
|
|
267
|
+
"different"
|
|
268
|
+
],
|
|
269
|
+
"description": "Only imports between the same instance, or different instances, of `files`, which must be an element with a capture."
|
|
270
|
+
},
|
|
271
|
+
"dependency": {
|
|
272
|
+
"enum": [
|
|
273
|
+
"dev",
|
|
274
|
+
"undeclared"
|
|
275
|
+
],
|
|
276
|
+
"description": "Only imports of packages that the importing file's nearest package.json lists only as development dependencies, or does not list at all."
|
|
277
|
+
},
|
|
278
|
+
"transitively": {
|
|
279
|
+
"type": "boolean",
|
|
280
|
+
"description": "Follow chains of imports, not only direct ones."
|
|
281
|
+
},
|
|
282
|
+
"stopAt": {
|
|
283
|
+
"$ref": "#/definitions/selector",
|
|
284
|
+
"description": "Files where a chain ends, such as `{ \"directive\": \"use server\" }`; needs `transitively: true`."
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
"dependencies": {
|
|
288
|
+
"stopAt": {
|
|
289
|
+
"required": [
|
|
290
|
+
"transitively"
|
|
291
|
+
],
|
|
292
|
+
"properties": {
|
|
293
|
+
"transitively": {
|
|
294
|
+
"const": true
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
"if": {
|
|
300
|
+
"required": [
|
|
301
|
+
"transitively"
|
|
302
|
+
],
|
|
303
|
+
"properties": {
|
|
304
|
+
"transitively": {
|
|
305
|
+
"const": true
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
"then": {
|
|
310
|
+
"properties": {
|
|
311
|
+
"imports": {
|
|
312
|
+
"enum": [
|
|
313
|
+
"all",
|
|
314
|
+
"runtime"
|
|
315
|
+
]
|
|
316
|
+
},
|
|
317
|
+
"names": false,
|
|
318
|
+
"specifier": false,
|
|
319
|
+
"instance": false,
|
|
320
|
+
"dependency": false
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"type": "object",
|
|
326
|
+
"description": "The files may import only the other side, and each other.",
|
|
327
|
+
"additionalProperties": false,
|
|
328
|
+
"required": [
|
|
329
|
+
"files",
|
|
330
|
+
"mayOnlyImport"
|
|
331
|
+
],
|
|
332
|
+
"properties": {
|
|
333
|
+
"files": {
|
|
334
|
+
"$ref": "#/definitions/selector",
|
|
335
|
+
"description": "The files the rule is about."
|
|
336
|
+
},
|
|
337
|
+
"name": {
|
|
338
|
+
"type": "string",
|
|
339
|
+
"description": "The rule's name, for exceptions and the baseline; each rule gives a default."
|
|
340
|
+
},
|
|
341
|
+
"reason": {
|
|
342
|
+
"type": "string",
|
|
343
|
+
"description": "Why the rule exists, shown with each violation."
|
|
344
|
+
},
|
|
345
|
+
"link": {
|
|
346
|
+
"type": "string",
|
|
347
|
+
"description": "Where to read more, shown with each violation."
|
|
348
|
+
},
|
|
349
|
+
"imports": {
|
|
350
|
+
"enum": [
|
|
351
|
+
"all",
|
|
352
|
+
"runtime",
|
|
353
|
+
"types"
|
|
354
|
+
],
|
|
355
|
+
"description": "Which imports the rule checks: all of them, those that stay at runtime, or type imports."
|
|
356
|
+
},
|
|
357
|
+
"examples": {
|
|
358
|
+
"$ref": "#/definitions/examples"
|
|
359
|
+
},
|
|
360
|
+
"mayOnlyImport": {
|
|
361
|
+
"$ref": "#/definitions/side",
|
|
362
|
+
"description": "All that the files may import, besides each other."
|
|
363
|
+
},
|
|
364
|
+
"names": {
|
|
365
|
+
"type": "array",
|
|
366
|
+
"items": {
|
|
367
|
+
"type": "string",
|
|
368
|
+
"minLength": 1
|
|
369
|
+
},
|
|
370
|
+
"minItems": 1,
|
|
371
|
+
"description": "Only imports of these names."
|
|
372
|
+
},
|
|
373
|
+
"specifier": {
|
|
374
|
+
"enum": [
|
|
375
|
+
"relative",
|
|
376
|
+
"parent",
|
|
377
|
+
"alias",
|
|
378
|
+
"package"
|
|
379
|
+
],
|
|
380
|
+
"description": "Only imports written this way: `relative` starts with `./` or `../`, `parent` with `../`, `alias` goes through a tsconfig path or a package `imports` field, and `package` names a package."
|
|
381
|
+
},
|
|
382
|
+
"instance": {
|
|
383
|
+
"enum": [
|
|
384
|
+
"same",
|
|
385
|
+
"different"
|
|
386
|
+
],
|
|
387
|
+
"description": "Only imports between the same instance, or different instances, of `files`, which must be an element with a capture."
|
|
388
|
+
},
|
|
389
|
+
"dependency": {
|
|
390
|
+
"enum": [
|
|
391
|
+
"dev",
|
|
392
|
+
"undeclared"
|
|
393
|
+
],
|
|
394
|
+
"description": "Only imports of packages that the importing file's nearest package.json lists only as development dependencies, or does not list at all."
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"type": "object",
|
|
400
|
+
"description": "Only the other side, and the files themselves, may import the files.",
|
|
401
|
+
"additionalProperties": false,
|
|
402
|
+
"required": [
|
|
403
|
+
"files",
|
|
404
|
+
"mayOnlyBeImportedBy"
|
|
405
|
+
],
|
|
406
|
+
"properties": {
|
|
407
|
+
"files": {
|
|
408
|
+
"$ref": "#/definitions/selector",
|
|
409
|
+
"description": "The files the rule is about."
|
|
410
|
+
},
|
|
411
|
+
"name": {
|
|
412
|
+
"type": "string",
|
|
413
|
+
"description": "The rule's name, for exceptions and the baseline; each rule gives a default."
|
|
414
|
+
},
|
|
415
|
+
"reason": {
|
|
416
|
+
"type": "string",
|
|
417
|
+
"description": "Why the rule exists, shown with each violation."
|
|
418
|
+
},
|
|
419
|
+
"link": {
|
|
420
|
+
"type": "string",
|
|
421
|
+
"description": "Where to read more, shown with each violation."
|
|
422
|
+
},
|
|
423
|
+
"imports": {
|
|
424
|
+
"enum": [
|
|
425
|
+
"all",
|
|
426
|
+
"runtime",
|
|
427
|
+
"types"
|
|
428
|
+
],
|
|
429
|
+
"description": "Which imports the rule checks: all of them, those that stay at runtime, or type imports."
|
|
430
|
+
},
|
|
431
|
+
"examples": {
|
|
432
|
+
"$ref": "#/definitions/examples"
|
|
433
|
+
},
|
|
434
|
+
"mayOnlyBeImportedBy": {
|
|
435
|
+
"$ref": "#/definitions/side",
|
|
436
|
+
"description": "All that may import the files, besides the files themselves."
|
|
437
|
+
},
|
|
438
|
+
"names": {
|
|
439
|
+
"type": "array",
|
|
440
|
+
"items": {
|
|
441
|
+
"type": "string",
|
|
442
|
+
"minLength": 1
|
|
443
|
+
},
|
|
444
|
+
"minItems": 1,
|
|
445
|
+
"description": "Only imports of these names."
|
|
446
|
+
},
|
|
447
|
+
"specifier": {
|
|
448
|
+
"enum": [
|
|
449
|
+
"relative",
|
|
450
|
+
"parent",
|
|
451
|
+
"alias",
|
|
452
|
+
"package"
|
|
453
|
+
],
|
|
454
|
+
"description": "Only imports written this way: `relative` starts with `./` or `../`, `parent` with `../`, `alias` goes through a tsconfig path or a package `imports` field, and `package` names a package."
|
|
455
|
+
},
|
|
456
|
+
"instance": {
|
|
457
|
+
"enum": [
|
|
458
|
+
"same",
|
|
459
|
+
"different"
|
|
460
|
+
],
|
|
461
|
+
"description": "Only imports between the same instance, or different instances, of `files`, which must be an element with a capture."
|
|
462
|
+
},
|
|
463
|
+
"dependency": {
|
|
464
|
+
"enum": [
|
|
465
|
+
"dev",
|
|
466
|
+
"undeclared"
|
|
467
|
+
],
|
|
468
|
+
"description": "Only imports of packages that the importing file's nearest package.json lists only as development dependencies, or does not list at all."
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"type": "object",
|
|
474
|
+
"description": "The names of the files are in a style, or match a name pattern.",
|
|
475
|
+
"additionalProperties": false,
|
|
476
|
+
"required": [
|
|
477
|
+
"files",
|
|
478
|
+
"mustBeNamed"
|
|
479
|
+
],
|
|
480
|
+
"properties": {
|
|
481
|
+
"files": {
|
|
482
|
+
"$ref": "#/definitions/selector",
|
|
483
|
+
"description": "The files the rule is about."
|
|
484
|
+
},
|
|
485
|
+
"name": {
|
|
486
|
+
"type": "string",
|
|
487
|
+
"description": "The rule's name, for exceptions and the baseline; each rule gives a default."
|
|
488
|
+
},
|
|
489
|
+
"reason": {
|
|
490
|
+
"type": "string",
|
|
491
|
+
"description": "Why the rule exists, shown with each violation."
|
|
492
|
+
},
|
|
493
|
+
"link": {
|
|
494
|
+
"type": "string",
|
|
495
|
+
"description": "Where to read more, shown with each violation."
|
|
496
|
+
},
|
|
497
|
+
"examples": {
|
|
498
|
+
"$ref": "#/definitions/examples"
|
|
499
|
+
},
|
|
500
|
+
"mustBeNamed": {
|
|
501
|
+
"anyOf": [
|
|
502
|
+
{
|
|
503
|
+
"$ref": "#/definitions/style"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"$ref": "#/definitions/namePattern"
|
|
507
|
+
}
|
|
508
|
+
],
|
|
509
|
+
"description": "A style that the name, up to the first dot, must be in, or a name pattern that the full name, without the last extension, must match."
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"type": "object",
|
|
515
|
+
"description": "The names of the folders are in a style, or match a name pattern.",
|
|
516
|
+
"additionalProperties": false,
|
|
517
|
+
"required": [
|
|
518
|
+
"folders",
|
|
519
|
+
"mustBeNamed"
|
|
520
|
+
],
|
|
521
|
+
"properties": {
|
|
522
|
+
"folders": {
|
|
523
|
+
"oneOf": [
|
|
524
|
+
{
|
|
525
|
+
"type": "string",
|
|
526
|
+
"minLength": 1
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
"type": "array",
|
|
530
|
+
"items": {
|
|
531
|
+
"type": "string",
|
|
532
|
+
"minLength": 1
|
|
533
|
+
},
|
|
534
|
+
"minItems": 1
|
|
535
|
+
}
|
|
536
|
+
],
|
|
537
|
+
"description": "The folders the rule is about: those that one of these patterns matches, below the pattern's fixed part, so `src/**` is every folder inside `src`. A pattern that starts with `!` leaves the folders it matches out."
|
|
538
|
+
},
|
|
539
|
+
"name": {
|
|
540
|
+
"type": "string",
|
|
541
|
+
"description": "The rule's name, for exceptions and the baseline; each rule gives a default."
|
|
542
|
+
},
|
|
543
|
+
"reason": {
|
|
544
|
+
"type": "string",
|
|
545
|
+
"description": "Why the rule exists, shown with each violation."
|
|
546
|
+
},
|
|
547
|
+
"link": {
|
|
548
|
+
"type": "string",
|
|
549
|
+
"description": "Where to read more, shown with each violation."
|
|
550
|
+
},
|
|
551
|
+
"examples": {
|
|
552
|
+
"$ref": "#/definitions/examples"
|
|
553
|
+
},
|
|
554
|
+
"mustBeNamed": {
|
|
555
|
+
"anyOf": [
|
|
556
|
+
{
|
|
557
|
+
"$ref": "#/definitions/style"
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
"$ref": "#/definitions/namePattern"
|
|
561
|
+
}
|
|
562
|
+
],
|
|
563
|
+
"description": "A style that each folder's name must be in, or a name pattern that it must match, which may use `{FolderName}` for the folder that holds it."
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"type": "object",
|
|
569
|
+
"description": "Each instance of the element, which must have a capture, has a file that matches the pattern.",
|
|
570
|
+
"additionalProperties": false,
|
|
571
|
+
"required": [
|
|
572
|
+
"files",
|
|
573
|
+
"mustContain"
|
|
574
|
+
],
|
|
575
|
+
"properties": {
|
|
576
|
+
"files": {
|
|
577
|
+
"$ref": "#/definitions/selector",
|
|
578
|
+
"description": "The files the rule is about."
|
|
579
|
+
},
|
|
580
|
+
"name": {
|
|
581
|
+
"type": "string",
|
|
582
|
+
"description": "The rule's name, for exceptions and the baseline; each rule gives a default."
|
|
583
|
+
},
|
|
584
|
+
"reason": {
|
|
585
|
+
"type": "string",
|
|
586
|
+
"description": "Why the rule exists, shown with each violation."
|
|
587
|
+
},
|
|
588
|
+
"link": {
|
|
589
|
+
"type": "string",
|
|
590
|
+
"description": "Where to read more, shown with each violation."
|
|
591
|
+
},
|
|
592
|
+
"examples": {
|
|
593
|
+
"$ref": "#/definitions/examples"
|
|
594
|
+
},
|
|
595
|
+
"mustContain": {
|
|
596
|
+
"oneOf": [
|
|
597
|
+
{
|
|
598
|
+
"type": "string",
|
|
599
|
+
"minLength": 1
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"type": "array",
|
|
603
|
+
"items": {
|
|
604
|
+
"type": "string",
|
|
605
|
+
"minLength": 1
|
|
606
|
+
},
|
|
607
|
+
"minItems": 1
|
|
608
|
+
}
|
|
609
|
+
],
|
|
610
|
+
"description": "A pattern, or a list of patterns one of which, some file of each instance must match, relative to the instance's root."
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
"type": "object",
|
|
616
|
+
"description": "Each folder has a file that matches the pattern.",
|
|
617
|
+
"additionalProperties": false,
|
|
618
|
+
"required": [
|
|
619
|
+
"folders",
|
|
620
|
+
"mustContain"
|
|
621
|
+
],
|
|
622
|
+
"properties": {
|
|
623
|
+
"folders": {
|
|
624
|
+
"oneOf": [
|
|
625
|
+
{
|
|
626
|
+
"type": "string",
|
|
627
|
+
"minLength": 1
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"type": "array",
|
|
631
|
+
"items": {
|
|
632
|
+
"type": "string",
|
|
633
|
+
"minLength": 1
|
|
634
|
+
},
|
|
635
|
+
"minItems": 1
|
|
636
|
+
}
|
|
637
|
+
],
|
|
638
|
+
"description": "The folders the rule is about: those that one of these patterns matches, below the pattern's fixed part, so `src/**` is every folder inside `src`. A pattern that starts with `!` leaves the folders it matches out."
|
|
639
|
+
},
|
|
640
|
+
"name": {
|
|
641
|
+
"type": "string",
|
|
642
|
+
"description": "The rule's name, for exceptions and the baseline; each rule gives a default."
|
|
643
|
+
},
|
|
644
|
+
"reason": {
|
|
645
|
+
"type": "string",
|
|
646
|
+
"description": "Why the rule exists, shown with each violation."
|
|
647
|
+
},
|
|
648
|
+
"link": {
|
|
649
|
+
"type": "string",
|
|
650
|
+
"description": "Where to read more, shown with each violation."
|
|
651
|
+
},
|
|
652
|
+
"examples": {
|
|
653
|
+
"$ref": "#/definitions/examples"
|
|
654
|
+
},
|
|
655
|
+
"mustContain": {
|
|
656
|
+
"oneOf": [
|
|
657
|
+
{
|
|
658
|
+
"type": "string",
|
|
659
|
+
"minLength": 1
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"type": "array",
|
|
663
|
+
"items": {
|
|
664
|
+
"type": "string",
|
|
665
|
+
"minLength": 1
|
|
666
|
+
},
|
|
667
|
+
"minItems": 1
|
|
668
|
+
}
|
|
669
|
+
],
|
|
670
|
+
"description": "A pattern, or a list of patterns one of which, some file of each folder must match, relative to the folder."
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
"type": "object",
|
|
676
|
+
"description": "No file may be among the files.",
|
|
677
|
+
"additionalProperties": false,
|
|
678
|
+
"required": [
|
|
679
|
+
"files",
|
|
680
|
+
"mustNotExist"
|
|
681
|
+
],
|
|
682
|
+
"properties": {
|
|
683
|
+
"files": {
|
|
684
|
+
"$ref": "#/definitions/selector",
|
|
685
|
+
"description": "The files the rule is about."
|
|
686
|
+
},
|
|
687
|
+
"name": {
|
|
688
|
+
"type": "string",
|
|
689
|
+
"description": "The rule's name, for exceptions and the baseline; each rule gives a default."
|
|
690
|
+
},
|
|
691
|
+
"reason": {
|
|
692
|
+
"type": "string",
|
|
693
|
+
"description": "Why the rule exists, shown with each violation."
|
|
694
|
+
},
|
|
695
|
+
"link": {
|
|
696
|
+
"type": "string",
|
|
697
|
+
"description": "Where to read more, shown with each violation."
|
|
698
|
+
},
|
|
699
|
+
"examples": {
|
|
700
|
+
"$ref": "#/definitions/examples"
|
|
701
|
+
},
|
|
702
|
+
"mustNotExist": {
|
|
703
|
+
"const": true,
|
|
704
|
+
"description": "No file may be among the files."
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"type": "object",
|
|
710
|
+
"description": "No folder may be among the folders.",
|
|
711
|
+
"additionalProperties": false,
|
|
712
|
+
"required": [
|
|
713
|
+
"folders",
|
|
714
|
+
"mustNotExist"
|
|
715
|
+
],
|
|
716
|
+
"properties": {
|
|
717
|
+
"folders": {
|
|
718
|
+
"oneOf": [
|
|
719
|
+
{
|
|
720
|
+
"type": "string",
|
|
721
|
+
"minLength": 1
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
"type": "array",
|
|
725
|
+
"items": {
|
|
726
|
+
"type": "string",
|
|
727
|
+
"minLength": 1
|
|
728
|
+
},
|
|
729
|
+
"minItems": 1
|
|
730
|
+
}
|
|
731
|
+
],
|
|
732
|
+
"description": "The folders the rule is about: those that one of these patterns matches, below the pattern's fixed part, so `src/**` is every folder inside `src`. A pattern that starts with `!` leaves the folders it matches out."
|
|
733
|
+
},
|
|
734
|
+
"name": {
|
|
735
|
+
"type": "string",
|
|
736
|
+
"description": "The rule's name, for exceptions and the baseline; each rule gives a default."
|
|
737
|
+
},
|
|
738
|
+
"reason": {
|
|
739
|
+
"type": "string",
|
|
740
|
+
"description": "Why the rule exists, shown with each violation."
|
|
741
|
+
},
|
|
742
|
+
"link": {
|
|
743
|
+
"type": "string",
|
|
744
|
+
"description": "Where to read more, shown with each violation."
|
|
745
|
+
},
|
|
746
|
+
"examples": {
|
|
747
|
+
"$ref": "#/definitions/examples"
|
|
748
|
+
},
|
|
749
|
+
"mustNotExist": {
|
|
750
|
+
"const": true,
|
|
751
|
+
"description": "No folder may be among the folders."
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
"type": "object",
|
|
757
|
+
"description": "Each file exports a name that matches the pattern; re-exports and the names an `export *` brings in count.",
|
|
758
|
+
"additionalProperties": false,
|
|
759
|
+
"required": [
|
|
760
|
+
"files",
|
|
761
|
+
"mustExport"
|
|
762
|
+
],
|
|
763
|
+
"properties": {
|
|
764
|
+
"files": {
|
|
765
|
+
"$ref": "#/definitions/selector",
|
|
766
|
+
"description": "The files the rule is about."
|
|
767
|
+
},
|
|
768
|
+
"name": {
|
|
769
|
+
"type": "string",
|
|
770
|
+
"description": "The rule's name, for exceptions and the baseline; each rule gives a default."
|
|
771
|
+
},
|
|
772
|
+
"reason": {
|
|
773
|
+
"type": "string",
|
|
774
|
+
"description": "Why the rule exists, shown with each violation."
|
|
775
|
+
},
|
|
776
|
+
"link": {
|
|
777
|
+
"type": "string",
|
|
778
|
+
"description": "Where to read more, shown with each violation."
|
|
779
|
+
},
|
|
780
|
+
"examples": {
|
|
781
|
+
"$ref": "#/definitions/examples"
|
|
782
|
+
},
|
|
783
|
+
"mustExport": {
|
|
784
|
+
"$ref": "#/definitions/namePattern",
|
|
785
|
+
"description": "The name pattern that some export must match, such as `{FileName}`."
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
"type": "object",
|
|
791
|
+
"description": "No file has a default export, an `export *`, or a named export that matches the pattern.",
|
|
792
|
+
"additionalProperties": false,
|
|
793
|
+
"required": [
|
|
794
|
+
"files",
|
|
795
|
+
"mayNotExport"
|
|
796
|
+
],
|
|
797
|
+
"properties": {
|
|
798
|
+
"files": {
|
|
799
|
+
"$ref": "#/definitions/selector",
|
|
800
|
+
"description": "The files the rule is about."
|
|
801
|
+
},
|
|
802
|
+
"name": {
|
|
803
|
+
"type": "string",
|
|
804
|
+
"description": "The rule's name, for exceptions and the baseline; each rule gives a default."
|
|
805
|
+
},
|
|
806
|
+
"reason": {
|
|
807
|
+
"type": "string",
|
|
808
|
+
"description": "Why the rule exists, shown with each violation."
|
|
809
|
+
},
|
|
810
|
+
"link": {
|
|
811
|
+
"type": "string",
|
|
812
|
+
"description": "Where to read more, shown with each violation."
|
|
813
|
+
},
|
|
814
|
+
"examples": {
|
|
815
|
+
"$ref": "#/definitions/examples"
|
|
816
|
+
},
|
|
817
|
+
"mayNotExport": {
|
|
818
|
+
"anyOf": [
|
|
819
|
+
{
|
|
820
|
+
"enum": [
|
|
821
|
+
"default",
|
|
822
|
+
"star"
|
|
823
|
+
]
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
"$ref": "#/definitions/namePattern"
|
|
827
|
+
}
|
|
828
|
+
],
|
|
829
|
+
"description": "`default` for a default export, `star` for `export *` and `export * as`, or a name pattern for named exports."
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
"type": "object",
|
|
835
|
+
"description": "Each file holds only imports, exports from other files, directives, and `export { … }` of names it imported.",
|
|
836
|
+
"additionalProperties": false,
|
|
837
|
+
"required": [
|
|
838
|
+
"files",
|
|
839
|
+
"mustOnlyReExport"
|
|
840
|
+
],
|
|
841
|
+
"properties": {
|
|
842
|
+
"files": {
|
|
843
|
+
"$ref": "#/definitions/selector",
|
|
844
|
+
"description": "The files the rule is about."
|
|
845
|
+
},
|
|
846
|
+
"name": {
|
|
847
|
+
"type": "string",
|
|
848
|
+
"description": "The rule's name, for exceptions and the baseline; each rule gives a default."
|
|
849
|
+
},
|
|
850
|
+
"reason": {
|
|
851
|
+
"type": "string",
|
|
852
|
+
"description": "Why the rule exists, shown with each violation."
|
|
853
|
+
},
|
|
854
|
+
"link": {
|
|
855
|
+
"type": "string",
|
|
856
|
+
"description": "Where to read more, shown with each violation."
|
|
857
|
+
},
|
|
858
|
+
"examples": {
|
|
859
|
+
"$ref": "#/definitions/examples"
|
|
860
|
+
},
|
|
861
|
+
"mustOnlyReExport": {
|
|
862
|
+
"const": true,
|
|
863
|
+
"description": "The files may only pass on what other files export."
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
"type": "object",
|
|
869
|
+
"description": "The files may not import each other in a cycle.",
|
|
870
|
+
"additionalProperties": false,
|
|
871
|
+
"required": [
|
|
872
|
+
"files",
|
|
873
|
+
"noCycles"
|
|
874
|
+
],
|
|
875
|
+
"properties": {
|
|
876
|
+
"files": {
|
|
877
|
+
"$ref": "#/definitions/selector",
|
|
878
|
+
"description": "The files the rule is about."
|
|
879
|
+
},
|
|
880
|
+
"name": {
|
|
881
|
+
"type": "string",
|
|
882
|
+
"description": "The rule's name, for exceptions and the baseline; each rule gives a default."
|
|
883
|
+
},
|
|
884
|
+
"reason": {
|
|
885
|
+
"type": "string",
|
|
886
|
+
"description": "Why the rule exists, shown with each violation."
|
|
887
|
+
},
|
|
888
|
+
"link": {
|
|
889
|
+
"type": "string",
|
|
890
|
+
"description": "Where to read more, shown with each violation."
|
|
891
|
+
},
|
|
892
|
+
"imports": {
|
|
893
|
+
"enum": [
|
|
894
|
+
"all",
|
|
895
|
+
"runtime",
|
|
896
|
+
"types"
|
|
897
|
+
],
|
|
898
|
+
"description": "Which imports the rule checks: all of them, those that stay at runtime, or type imports."
|
|
899
|
+
},
|
|
900
|
+
"examples": {
|
|
901
|
+
"$ref": "#/definitions/examples"
|
|
902
|
+
},
|
|
903
|
+
"noCycles": {
|
|
904
|
+
"const": true,
|
|
905
|
+
"description": "The files may not import each other in a cycle."
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
"type": "object",
|
|
911
|
+
"description": "A rule of several sentences, broken when any of them is. Each sentence takes `files` or `folders` and one condition, and leaves the name, reason, link, imports and examples to the rule.",
|
|
912
|
+
"additionalProperties": false,
|
|
913
|
+
"required": [
|
|
914
|
+
"name",
|
|
915
|
+
"sentences"
|
|
916
|
+
],
|
|
917
|
+
"properties": {
|
|
918
|
+
"name": {
|
|
919
|
+
"type": "string",
|
|
920
|
+
"description": "The rule's name, for exceptions and the baseline; a rule of several sentences has no default."
|
|
921
|
+
},
|
|
922
|
+
"reason": {
|
|
923
|
+
"type": "string",
|
|
924
|
+
"description": "Why the rule exists, shown with each violation."
|
|
925
|
+
},
|
|
926
|
+
"link": {
|
|
927
|
+
"type": "string",
|
|
928
|
+
"description": "Where to read more, shown with each violation."
|
|
929
|
+
},
|
|
930
|
+
"imports": {
|
|
931
|
+
"enum": [
|
|
932
|
+
"all",
|
|
933
|
+
"runtime",
|
|
934
|
+
"types"
|
|
935
|
+
],
|
|
936
|
+
"description": "Which imports the rule's import sentences check: all of them, those that stay at runtime, or type imports."
|
|
937
|
+
},
|
|
938
|
+
"examples": {
|
|
939
|
+
"$ref": "#/definitions/examples"
|
|
940
|
+
},
|
|
941
|
+
"sentences": {
|
|
942
|
+
"type": "array",
|
|
943
|
+
"minItems": 1,
|
|
944
|
+
"items": {
|
|
945
|
+
"type": "object",
|
|
946
|
+
"description": "A sentence: `files` or `folders`, and one condition with its options."
|
|
947
|
+
},
|
|
948
|
+
"description": "The sentences, each of which the rule's files must keep."
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
]
|
|
953
|
+
}
|
|
954
|
+
},
|
|
955
|
+
"ignore": {
|
|
956
|
+
"type": "array",
|
|
957
|
+
"items": {
|
|
958
|
+
"type": "string"
|
|
959
|
+
},
|
|
960
|
+
"description": "Lines in `.gitignore` syntax that remove files from the check."
|
|
961
|
+
},
|
|
962
|
+
"allowUnresolved": {
|
|
963
|
+
"type": "object",
|
|
964
|
+
"additionalProperties": {
|
|
965
|
+
"type": "string",
|
|
966
|
+
"minLength": 1
|
|
967
|
+
},
|
|
968
|
+
"description": "Specifiers that may stay unresolved, each with the reason; a specifier may end in `*`."
|
|
969
|
+
},
|
|
970
|
+
"plugins": {
|
|
971
|
+
"description": "The plugins a TypeScript or JavaScript config loads, by the name its rules use them by. A plugin is code, so a JSON config cannot load one.",
|
|
972
|
+
"not": {}
|
|
973
|
+
},
|
|
974
|
+
"extends": {
|
|
975
|
+
"description": "The presets a TypeScript or JavaScript config extends, such as `fsd({ root: 'src' })`. A preset is a function, so a JSON config cannot use one.",
|
|
976
|
+
"not": {}
|
|
977
|
+
},
|
|
978
|
+
"off": {
|
|
979
|
+
"type": "array",
|
|
980
|
+
"items": {
|
|
981
|
+
"type": "string",
|
|
982
|
+
"minLength": 1
|
|
983
|
+
},
|
|
984
|
+
"description": "Rule names to turn off after the presets are merged, such as `fsd/insignificant-slice`; a name that matches no rule is an error."
|
|
985
|
+
}
|
|
986
|
+
},
|
|
987
|
+
"definitions": {
|
|
988
|
+
"exampleFiles": {
|
|
989
|
+
"type": "object",
|
|
990
|
+
"additionalProperties": {
|
|
991
|
+
"type": "string"
|
|
992
|
+
},
|
|
993
|
+
"description": "Files by path, relative to the config folder, with their text."
|
|
994
|
+
},
|
|
995
|
+
"examples": {
|
|
996
|
+
"type": "object",
|
|
997
|
+
"additionalProperties": false,
|
|
998
|
+
"description": "File sets the rule must accept and must reject, which `archangel test` checks.",
|
|
999
|
+
"properties": {
|
|
1000
|
+
"accepted": {
|
|
1001
|
+
"type": "array",
|
|
1002
|
+
"items": {
|
|
1003
|
+
"$ref": "#/definitions/exampleFiles"
|
|
1004
|
+
}
|
|
1005
|
+
},
|
|
1006
|
+
"rejected": {
|
|
1007
|
+
"type": "array",
|
|
1008
|
+
"items": {
|
|
1009
|
+
"$ref": "#/definitions/exampleFiles"
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
},
|
|
1014
|
+
"selector": {
|
|
1015
|
+
"description": "Files: an element or selector by name, a path pattern with a `/` or a `*`, a list of these (any of them), or one combination.",
|
|
1016
|
+
"anyOf": [
|
|
1017
|
+
{
|
|
1018
|
+
"type": "string",
|
|
1019
|
+
"minLength": 1
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
"type": "array",
|
|
1023
|
+
"items": {
|
|
1024
|
+
"$ref": "#/definitions/selector"
|
|
1025
|
+
},
|
|
1026
|
+
"minItems": 1
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
"$ref": "#/definitions/selectorObject"
|
|
1030
|
+
}
|
|
1031
|
+
]
|
|
1032
|
+
},
|
|
1033
|
+
"selectorObject": {
|
|
1034
|
+
"oneOf": [
|
|
1035
|
+
{
|
|
1036
|
+
"type": "object",
|
|
1037
|
+
"additionalProperties": false,
|
|
1038
|
+
"required": [
|
|
1039
|
+
"all"
|
|
1040
|
+
],
|
|
1041
|
+
"properties": {
|
|
1042
|
+
"all": {
|
|
1043
|
+
"type": "array",
|
|
1044
|
+
"items": {
|
|
1045
|
+
"$ref": "#/definitions/selector"
|
|
1046
|
+
},
|
|
1047
|
+
"minItems": 1,
|
|
1048
|
+
"description": "The files in every one of these."
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
},
|
|
1052
|
+
{
|
|
1053
|
+
"type": "object",
|
|
1054
|
+
"additionalProperties": false,
|
|
1055
|
+
"required": [
|
|
1056
|
+
"any"
|
|
1057
|
+
],
|
|
1058
|
+
"properties": {
|
|
1059
|
+
"any": {
|
|
1060
|
+
"type": "array",
|
|
1061
|
+
"items": {
|
|
1062
|
+
"$ref": "#/definitions/selector"
|
|
1063
|
+
},
|
|
1064
|
+
"minItems": 1,
|
|
1065
|
+
"description": "The files in any one of these."
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
},
|
|
1069
|
+
{
|
|
1070
|
+
"type": "object",
|
|
1071
|
+
"additionalProperties": false,
|
|
1072
|
+
"required": [
|
|
1073
|
+
"not"
|
|
1074
|
+
],
|
|
1075
|
+
"properties": {
|
|
1076
|
+
"not": {
|
|
1077
|
+
"$ref": "#/definitions/selector",
|
|
1078
|
+
"description": "Every file except these."
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
"type": "object",
|
|
1084
|
+
"additionalProperties": false,
|
|
1085
|
+
"required": [
|
|
1086
|
+
"element"
|
|
1087
|
+
],
|
|
1088
|
+
"properties": {
|
|
1089
|
+
"element": {
|
|
1090
|
+
"type": "string",
|
|
1091
|
+
"minLength": 1,
|
|
1092
|
+
"description": "The files of this element of files, or of any element for `*`."
|
|
1093
|
+
},
|
|
1094
|
+
"capture": {
|
|
1095
|
+
"type": "object",
|
|
1096
|
+
"minProperties": 1,
|
|
1097
|
+
"additionalProperties": {
|
|
1098
|
+
"type": "string"
|
|
1099
|
+
},
|
|
1100
|
+
"description": "One instance of the element, by its captures, such as `{ \"feature\": \"login\" }`."
|
|
1101
|
+
}
|
|
1102
|
+
},
|
|
1103
|
+
"if": {
|
|
1104
|
+
"properties": {
|
|
1105
|
+
"element": {
|
|
1106
|
+
"const": "*"
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
},
|
|
1110
|
+
"then": {
|
|
1111
|
+
"properties": {
|
|
1112
|
+
"capture": false
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
},
|
|
1116
|
+
{
|
|
1117
|
+
"type": "object",
|
|
1118
|
+
"additionalProperties": false,
|
|
1119
|
+
"required": [
|
|
1120
|
+
"directive"
|
|
1121
|
+
],
|
|
1122
|
+
"properties": {
|
|
1123
|
+
"directive": {
|
|
1124
|
+
"type": "string",
|
|
1125
|
+
"minLength": 1,
|
|
1126
|
+
"description": "The files that start with this directive, such as `use client`."
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
]
|
|
1131
|
+
},
|
|
1132
|
+
"sideItem": {
|
|
1133
|
+
"anyOf": [
|
|
1134
|
+
{
|
|
1135
|
+
"type": "string",
|
|
1136
|
+
"minLength": 1
|
|
1137
|
+
},
|
|
1138
|
+
{
|
|
1139
|
+
"type": "object",
|
|
1140
|
+
"additionalProperties": false,
|
|
1141
|
+
"required": [
|
|
1142
|
+
"packages"
|
|
1143
|
+
],
|
|
1144
|
+
"properties": {
|
|
1145
|
+
"packages": {
|
|
1146
|
+
"type": "array",
|
|
1147
|
+
"items": {
|
|
1148
|
+
"type": "string",
|
|
1149
|
+
"minLength": 1
|
|
1150
|
+
},
|
|
1151
|
+
"minItems": 1,
|
|
1152
|
+
"description": "Packages by name; a name may end in `*`, and `*` is every package."
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
"$ref": "#/definitions/selectorObject"
|
|
1158
|
+
}
|
|
1159
|
+
]
|
|
1160
|
+
},
|
|
1161
|
+
"side": {
|
|
1162
|
+
"description": "The other side of an import condition: an element or selector by name, a path pattern, `{ \"packages\": [...] }`, a combination, or a list of these.",
|
|
1163
|
+
"anyOf": [
|
|
1164
|
+
{
|
|
1165
|
+
"$ref": "#/definitions/sideItem"
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
"type": "array",
|
|
1169
|
+
"items": {
|
|
1170
|
+
"$ref": "#/definitions/sideItem"
|
|
1171
|
+
},
|
|
1172
|
+
"minItems": 1
|
|
1173
|
+
}
|
|
1174
|
+
]
|
|
1175
|
+
},
|
|
1176
|
+
"style": {
|
|
1177
|
+
"enum": [
|
|
1178
|
+
"kebab-case",
|
|
1179
|
+
"camelCase",
|
|
1180
|
+
"PascalCase",
|
|
1181
|
+
"snake_case",
|
|
1182
|
+
"SCREAMING_SNAKE_CASE"
|
|
1183
|
+
],
|
|
1184
|
+
"description": "A way of writing the words of a name."
|
|
1185
|
+
},
|
|
1186
|
+
"namePattern": {
|
|
1187
|
+
"type": "string",
|
|
1188
|
+
"minLength": 1,
|
|
1189
|
+
"description": "A name: text, `*` for any text, and `{FileName}`, `{fileName}`, `{file-name}`, `{file_name}` or `{FILE_NAME}` for the file's name in each style, or the same spellings of `{FolderName}` for the name of the folder that holds it."
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
}
|