-
Notifications
You must be signed in to change notification settings - Fork 258
/
Copy pathconfiguration.schema.json
1164 lines (1164 loc) · 56.9 KB
/
configuration.schema.json
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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"title": "dependency-cruiser configuration",
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://dependency-cruiser.js.org/schema/configuration.schema.json",
"description": "A set of properties describing what dependencies are forbidden and what dependencies are allowed + options on how to cruise through the code",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": { "type": "string" },
"forbidden": {
"type": "array",
"description": "A list of rules that describe dependencies that are not allowed. dependency-cruiser will emit a separate error (warning/ informational) messages for each violated rule.",
"items": { "$ref": "#/definitions/ForbiddenRuleType" }
},
"allowed": {
"type": "array",
"description": "A list of rules that describe dependencies that are allowed. dependency-cruiser will emit the warning message 'not-in-allowed' for each dependency that does not at least meet one of them.",
"items": { "$ref": "#/definitions/AllowedRuleType" }
},
"allowedSeverity": {
"$ref": "#/definitions/SeverityType",
"description": "Severity to use when a dependency is not in the 'allowed' set of rules. Defaults to 'warn'"
},
"required": {
"type": "array",
"description": "A list of rules that describe what dependencies modules _must_ have. E.g. - every controller needs to (directly) depend on a base controller. - each source file should be the dependency of a spec file with the same base name",
"items": { "$ref": "#/definitions/RequiredRuleType" }
},
"options": { "$ref": "#/definitions/OptionsType" },
"extends": { "$ref": "#/definitions/ExtendsType" }
},
"definitions": {
"RuleSetType": {
"type": "object",
"additionalProperties": false,
"properties": {
"forbidden": {
"type": "array",
"description": "A list of rules that describe dependencies that are not allowed. dependency-cruiser will emit a separate error (warning/ informational) messages for each violated rule.",
"items": { "$ref": "#/definitions/ForbiddenRuleType" }
},
"allowed": {
"type": "array",
"description": "A list of rules that describe dependencies that are allowed. dependency-cruiser will emit the warning message 'not-in-allowed' for each dependency that does not at least meet one of them.",
"items": { "$ref": "#/definitions/AllowedRuleType" }
},
"allowedSeverity": {
"$ref": "#/definitions/SeverityType",
"description": "Severity to use when a dependency is not in the 'allowed' set of rules. Defaults to 'warn'"
},
"required": {
"type": "array",
"description": "A list of rules that describe what dependencies modules _must_ have. E.g. - every controller needs to (directly) depend on a base controller. - each source file should be the dependency of a spec file with the same base name",
"items": { "$ref": "#/definitions/RequiredRuleType" }
}
}
},
"AllowedRuleType": {
"oneOf": [
{ "$ref": "#/definitions/RegularAllowedRuleType" },
{ "$ref": "#/definitions/ReachabilityAllowedRuleType" }
]
},
"RegularAllowedRuleType": {
"type": "object",
"required": ["from", "to"],
"additionalProperties": false,
"properties": {
"comment": { "type": "string" },
"scope": {
"type": "string",
"description": "What to apply the rule to - modules (the default) or folders. Currently ignored for 'allowed' rules, defaulting to 'module'",
"enum": ["module", "folder"]
},
"from": { "$ref": "#/definitions/FromRestrictionType" },
"to": { "$ref": "#/definitions/ToRestrictionType" }
}
},
"ReachabilityAllowedRuleType": {
"type": "object",
"required": ["from", "to"],
"additionalProperties": false,
"properties": {
"comment": { "type": "string" },
"scope": {
"type": "string",
"description": "What to apply the rule to - modules (the default) or folders. Currently ignored for 'allowed' rules, defaulting to 'module'",
"enum": ["module", "folder"]
},
"from": { "$ref": "#/definitions/ReachabilityFromRestrictionType" },
"to": { "$ref": "#/definitions/ReachabilityToRestrictionType" }
}
},
"ForbiddenRuleType": {
"oneOf": [
{ "$ref": "#/definitions/RegularForbiddenRuleType" },
{ "$ref": "#/definitions/ReachabilityForbiddenRuleType" },
{ "$ref": "#/definitions/DependentsForbiddenRuleType" }
]
},
"RegularForbiddenRuleType": {
"type": "object",
"required": ["from", "to"],
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "A short name for the rule - will appear in reporters to enable customers to quickly identify a violated rule. Try to keep them short, eslint style. E.g. 'not-to-core' for a rule forbidding dependencies on core modules, or 'not-to-unresolvable' for one that prevents dependencies on modules that probably don't exist."
},
"severity": { "$ref": "#/definitions/SeverityType" },
"scope": {
"type": "string",
"description": "What to apply the rule to - modules (the default) or folders. Switching the scope to 'folder' can be useful in rules where this makes a difference like those regarding circular dependencies or instability. Only the to.moreUnstable, to.circular, and path (both from and to) attributes work at the moment. Other attributes will follow suit in later releases (depending on demand).",
"enum": ["module", "folder"]
},
"comment": {
"type": "string",
"description": "You can use this field to document why the rule is there."
},
"from": { "$ref": "#/definitions/FromRestrictionType" },
"to": { "$ref": "#/definitions/ToRestrictionType" }
}
},
"DependentsForbiddenRuleType": {
"type": "object",
"required": ["module", "from"],
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"severity": { "$ref": "#/definitions/SeverityType" },
"scope": {
"type": "string",
"description": "What to apply the rule to - modules (the default) or folders. Currently ignored for DependentsForbiddenRules, defaulting to 'module'",
"enum": ["module", "folder"]
},
"comment": { "type": "string" },
"module": { "$ref": "#/definitions/DependentsModuleRestrictionType" },
"from": { "$ref": "#/definitions/DependentsFromRestrictionType" }
}
},
"ReachabilityForbiddenRuleType": {
"type": "object",
"required": ["from", "to"],
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"severity": { "$ref": "#/definitions/SeverityType" },
"scope": {
"type": "string",
"description": "What to apply the rule to - modules (the default) or folders. Currently ignored for ReachabilityForbiddenRules, defaulting to 'module'",
"enum": ["module", "folder"]
},
"comment": { "type": "string" },
"from": { "$ref": "#/definitions/ReachabilityFromRestrictionType" },
"to": { "$ref": "#/definitions/ReachabilityToRestrictionType" }
}
},
"RequiredRuleType": {
"type": "object",
"required": ["module", "to"],
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"severity": { "$ref": "#/definitions/SeverityType" },
"scope": {
"type": "string",
"description": "What to apply the rule to - modules (the default) or folders. Currently ignored for RequiredRules, defaulting to 'module'",
"enum": ["module", "folder"]
},
"comment": { "type": "string" },
"module": { "$ref": "#/definitions/RequiredModuleRestrictionType" },
"to": { "$ref": "#/definitions/RequiredToRestrictionType" }
}
},
"MiniDependencyRestrictionType": {
"oneOf": [
{ "$ref": "#/definitions/REAsStringsType" },
{
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"description": "A regular expression or an array of regular expressions the 'via' module should match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"pathNot": {
"description": "A regular expression or an array of regular expressions an the 'via' module should _not_ match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"dependencyTypes": {
"type": "array",
"description": "Which dependency types the dependency between this via and the previous one in the 'via chain' should have to be caught by this rule.",
"items": { "$ref": "#/definitions/DependencyTypeType" }
},
"dependencyTypesNot": {
"type": "array",
"description": "Which dependency types the dependency between this via and the previous one in the 'via chain' should _not_ have to be caught by this rule.",
"items": { "$ref": "#/definitions/DependencyTypeType" }
}
}
}
]
},
"FromRestrictionType": {
"type": "object",
"description": "Criteria an end of a dependency should match to be caught by this rule. Leave it empty if you want any module to be matched.",
"additionalProperties": false,
"properties": {
"path": {
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"pathNot": {
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"orphan": {
"type": "boolean",
"description": "Whether or not to match when the module is an orphan (= has no incoming or outgoing dependencies). When this property it is part of a rule, dependency-cruiser will ignore the 'to' part."
}
}
},
"ReachabilityFromRestrictionType": {
"type": "object",
"description": "Criteria an end of a dependency should match to be caught by this rule. Leave it empty if you want any module to be matched.",
"additionalProperties": false,
"properties": {
"path": {
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"pathNot": {
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
}
}
},
"ToRestrictionType": {
"type": "object",
"description": "Criteria the 'to' end of a dependency should match to be caught by this rule. Leave it empty if you want any module to be matched.",
"additionalProperties": false,
"properties": {
"path": {
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"pathNot": {
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"couldNotResolve": {
"type": "boolean",
"description": "Whether or not to match modules dependency-cruiser could not resolve (and probably aren't on disk). For this one too: leave out if you don't care either way."
},
"circular": {
"type": "boolean",
"description": "Whether or not to match when following to the to will ultimately end up in the from."
},
"dynamic": {
"type": "boolean",
"description": "Whether or not to match when the dependency is a dynamic one."
},
"exoticallyRequired": {
"type": "boolean",
"description": "Whether or not to match when the dependency is exotically required."
},
"exoticRequire": {
"description": "A regular expression to match against any 'exotic' require strings",
"$ref": "#/definitions/REAsStringsType"
},
"exoticRequireNot": {
"description": "A regular expression to match against any 'exotic' require strings - when it should NOT be caught by the rule",
"$ref": "#/definitions/REAsStringsType"
},
"preCompilationOnly": {
"type": "boolean",
"description": "true if this dependency only exists before compilation (like type only imports), false in all other cases. Only returned when the tsPreCompilationDeps is set to 'specify'."
},
"dependencyTypes": {
"type": "array",
"description": "Whether or not to match modules of any of these types (leaving out matches any of them)",
"items": { "$ref": "#/definitions/DependencyTypeType" }
},
"dependencyTypesNot": {
"type": "array",
"description": "Whether or not to match modules NOT of any of these types (leaving out matches none of them)",
"items": { "$ref": "#/definitions/DependencyTypeType" }
},
"moreThanOneDependencyType": {
"type": "boolean",
"description": "If true matches dependencies with more than one dependency type (e.g. defined in _both_ npm and npm-dev)"
},
"license": {
"description": "Whether or not to match modules that were released under one of the mentioned licenses. E.g. to flag GPL-1.0, GPL-2.0 licensed modules (e.g. because your app is not compatible with the GPL) use \"GPL\"",
"$ref": "#/definitions/REAsStringsType"
},
"licenseNot": {
"description": "Whether or not to match modules that were NOT released under one of the mentioned licenses. E.g. to flag everything non MIT use \"MIT\" here",
"$ref": "#/definitions/REAsStringsType"
},
"via": {
"description": "For circular dependencies - whether or not to match cycles that include some modules with these conditions. If you want to match cycles that _exclusively_ include modules satisfying them use the viaOnly restriction.E.g. to allow all cycles, except when they go through one specific module. Typically to temporarily disallow some cycles with a lower severity - setting up a rule with a via that ignores them in an 'allowed' section.",
"$ref": "#/definitions/MiniDependencyRestrictionType"
},
"viaOnly": {
"description": "For circular dependencies - whether or not to match cycles that include exclusively modules with these conditions. This is different from the regular via that already matches when only _some_ of the modules in the cycle satisfy the condition.",
"$ref": "#/definitions/MiniDependencyRestrictionType"
},
"viaNot": {
"description": "This attribute is deprecated. Use 'viaOnly' with a 'pathNot' attribute in stead.",
"deprecated": true,
"$ref": "#/definitions/REAsStringsType"
},
"viaSomeNot": {
"description": "This attribute is deprecated. Use 'via' with a 'pathNot' attribute in stead.",
"deprecated": true,
"$ref": "#/definitions/REAsStringsType"
},
"moreUnstable": {
"type": "boolean",
"description": "When set to true moreUnstable matches for any dependency that has a higher Instability than the module that depends on it. When set to false it matches when the opposite is true; the dependency has an equal or lower Instability. This attribute is useful when you want to check against Robert C. Martin's stable dependency principle. See online documentation for examples and details. Leave this out when you don't care either way."
}
}
},
"DependentsModuleRestrictionType": {
"description": "Criteria to select the module(s) this restriction should apply to",
"required": [],
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"pathNot": {
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"numberOfDependentsLessThan": {
"type": "integer",
"description": "Matches when the number of times the 'to' module is used falls below (<) this number. Caveat: only works in concert with path and pathNot restrictions in the from and to parts of the rule; other conditions will be ignored. E.g. to flag modules that are used only once or not at all, use 2 here.",
"minimum": 0,
"maximum": 100
},
"numberOfDependentsMoreThan": {
"type": "integer",
"description": "Matches when the number of times the 'to' module is used raises above (>) this number. Caveat: only works in concert with path and pathNot restrictions in the from and to parts of the rule; other conditions will be ignored. E.g. to flag modules that are used more than 10 times, use 10 here.",
"minimum": 0,
"maximum": 100
}
}
},
"DependentsFromRestrictionType": {
"description": "Criteria the dependents of the module should adhere to be caught by this rule rule. Leave it empty if you want any dependent to be matched.",
"required": [],
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"pathNot": {
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
}
}
},
"ReachabilityToRestrictionType": {
"description": "Criteria the 'to' end of a dependency should match to be caught by this rule. Leave it empty if you want any module to be matched.",
"required": ["reachable"],
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"pathNot": {
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"reachable": {
"type": "boolean",
"description": "Whether or not to match modules that aren't reachable from the from part of the rule."
}
}
},
"RequiredModuleRestrictionType": {
"description": "Criteria to select the module(s) this restriction should apply to",
"required": [],
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"pathNot": {
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
}
}
},
"RequiredToRestrictionType": {
"description": "Criteria for modules the associated module must depend on.",
"required": [],
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"description": "Criteria at least one dependency of each matching module must adhere to.",
"$ref": "#/definitions/REAsStringsType"
},
"reachable": {
"type": "boolean",
"description": "Whether or not to match transitive ('indirect') dependencies as well as direct ones."
}
}
},
"DependencyTypeType": {
"type": "string",
"enum": [
"aliased-subpath-import",
"aliased-tsconfig-base-url",
"aliased-tsconfig-paths",
"aliased-tsconfig",
"aliased-webpack",
"aliased-workspace",
"aliased",
"amd-define",
"amd-require",
"amd-exotic-require",
"core",
"deprecated",
"dynamic-import",
"exotic-require",
"export",
"import-equals",
"import",
"jsdoc",
"jsdoc-bracket-import",
"jsdoc-import-tag",
"local",
"localmodule",
"npm-bundled",
"npm-dev",
"npm-no-pkg",
"npm-optional",
"npm-peer",
"npm-unknown",
"npm",
"pre-compilation-only",
"require",
"triple-slash-amd-dependency",
"triple-slash-directive",
"triple-slash-file-reference",
"triple-slash-type-reference",
"type-import",
"type-only",
"undetermined",
"unknown"
]
},
"REAsStringsType": {
"oneOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
]
},
"SeverityType": {
"type": "string",
"description": "How severe a violation of a rule is. The 'error' severity will make some reporters return a non-zero exit code, so if you want e.g. a build to stop when there's a rule violated: use that.",
"enum": ["error", "warn", "info", "ignore"]
},
"OptionsType": {
"type": "object",
"description": "Runtime configuration options",
"additionalProperties": false,
"properties": {
"doNotFollow": {
"description": "a regular expression for modules to include, but not follow further",
"oneOf": [
{ "$ref": "#/definitions/REAsStringsType" },
{ "$ref": "#/definitions/CompoundDoNotFollowType" }
]
},
"exclude": {
"description": "a regular expression for modules to exclude from being cruised",
"oneOf": [
{ "$ref": "#/definitions/REAsStringsType" },
{ "$ref": "#/definitions/CompoundExcludeType" }
]
},
"includeOnly": {
"description": "a regular expression for modules to cruise; anything outside it will be skipped",
"oneOf": [
{ "$ref": "#/definitions/REAsStringsType" },
{ "$ref": "#/definitions/CompoundIncludeOnlyType" }
]
},
"focus": {
"description": "dependency-cruiser will include modules matching this regular expression in its output, as well as their neighbours (direct dependencies and dependents)",
"oneOf": [
{ "$ref": "#/definitions/REAsStringsType" },
{ "$ref": "#/definitions/CompoundFocusType" }
]
},
"reaches": {
"description": "dependency-cruiser will include modules matching this regular expression in its output, as well as _any_ module that reaches them - either directly or via via",
"oneOf": [
{ "$ref": "#/definitions/REAsStringsType" },
{ "$ref": "#/definitions/CompoundReachesType" }
]
},
"affected": {
"description": "dependency-cruiser will mark modules that have changed since the specified revision (or 'main', when not specified) in its output, as well as _any_ module that reaches them - either directly or via via. NOTE: this is currently a command line _only_ option, so if you pass this to the API or in a configuration file it will be ignored.",
"oneOf": [{ "type": "string" }, { "type": "boolean" }]
},
"highlight": {
"description": "dependency-cruiser will mark modules matching this regular expression as 'highlighted' in its output",
"oneOf": [
{ "$ref": "#/definitions/REAsStringsType" },
{ "$ref": "#/definitions/CompoundHighlightType" }
]
},
"knownViolations": {
"description": "baseline of known validations. Typically you'd specify these in a file called .dependency-cruiser-known-violations.json (which you'd generate with the --outputType 'baseline') - and which is easy to keep up to date. In a pinch you can specify them here as well. The known violations in .dependency-cruiser-known-violations.json always take precedence.",
"$ref": "#/definitions/ViolationsType"
},
"collapse": {
"description": "Collapse a to a folder depth by passing a single digit (e.g. 2). When passed a regex collapses to that pattern E.g. ^packages/[^/]+/ would collapse to modules/ folders directly under your packages folder.",
"oneOf": [
{ "type": "string" },
{ "type": "integer", "minimum": 1, "maximum": 9 }
]
},
"maxDepth": {
"type": "integer",
"minimum": 0,
"maximum": 99,
"description": "The maximum cruise depth specified. 0 means no maximum specified. While it might look attractive to regulate the size of the output, this is not the best option to do so. Filters (exclude, includeOnly, focus), the dot and archi reporter's collapsePattern and the collapse options offer better, more reliable and more understandable results."
},
"moduleSystems": { "$ref": "#/definitions/ModuleSystemsType" },
"detectJSDocImports": {
"type": "boolean",
"description": "When true, dependency-cruiser will detect dependencies in JSDoc-style import statements. Implies `\"parser\": \"tsc\"`. Defaults to false."
},
"prefix": { "type": "string" },
"preserveSymlinks": {
"type": "boolean",
"description": "if true leave symlinks untouched, otherwise use the realpath. Defaults to `false` (which is also nodejs's default behavior since version 6)"
},
"combinedDependencies": {
"type": "boolean",
"description": "if true combines the package.jsons found from the module up to the base folder the cruise is initiated from. Useful for how (some) mono-repos manage dependencies & dependency definitions. Defaults to `false`."
},
"tsConfig": {
"type": "object",
"additionalProperties": false,
"description": "TypeScript project file ('tsconfig.json') to use for (1) compilation and (2) resolution (e.g. with the paths property)",
"properties": {
"fileName": {
"description": "The TypeScript project file to use. The fileName is relative to dependency-cruiser's current working directory. When not provided defaults to './tsconfig.json'.",
"type": "string"
}
}
},
"tsPreCompilationDeps": {
"description": "if true detect dependencies that only exist before typescript-to-javascript compilation.",
"oneOf": [
{ "type": "boolean" },
{ "type": "string", "enum": ["specify"] }
]
},
"extraExtensionsToScan": {
"type": "array",
"description": "List of extensions to scan _in addition_ to the extensions already covered by any available parser. Dependency-cruiser will consider files ending in these extensions but it will _not_ examine its content or derive any of their dependencies Sample value: [\".jpg\", \".png\", \".json\"]",
"items": { "type": "string" }
},
"externalModuleResolutionStrategy": {
"type": "string",
"description": "What external module resolution strategy to use. Defaults to 'node_modules' (not used anymore - module resolution strategy determination is automatic now)",
"enum": ["node_modules", "yarn-pnp"]
},
"builtInModules": {
"type": "object",
"additionalProperties": false,
"description": "Options to tweak what dependency-cruiser considers 'built-in' modules. If you're targeting nodejs, or don't use any built-in modules you can probably leave this alone.",
"properties": {
"override": {
"type": "array",
"description": "List of module names that are to be considered as 'built-in'. By default dependency-cruiser uses the list of built-ins from nodejs. If you code for another environment (e.g. the browser) and you use shims for nodejs builtins like 'path' from node_modules, you could pass an empty array here. If you want to just add a couple of extra built-ins to the default list, use the 'add' attribute instead.",
"items": { "type": "string" }
},
"add": {
"type": "array",
"description": "List of module names that are to be considered as 'built-in' in addition to the default list of the environment you're currently in. Use this e.g. if you're writing electron code and want to add 'electron' as built-in.",
"items": { "type": "string" }
}
}
},
"forceDeriveDependents": {
"type": "boolean",
"deprecated": true,
"description": "Hasn't had any effect on dependency-cruiser's behaviour since a few major versions ago. If there's a need to manipulate this use the `skipAnalysisNotInRules` option in stead. Previously documented behaviour: When true includes de-normalized dependents in the cruise-result, even though there's no rule in the rule set that requires them. Defaults to false."
},
"webpackConfig": {
"type": "object",
"additionalProperties": false,
"description": "Webpack configuration file to use to get resolve options from",
"properties": {
"fileName": {
"type": "string",
"description": "The webpack conf file to use (typically something like 'webpack.conf.js'). The fileName is relative to dependency-cruiser's current working directory. When not provided defaults to './webpack.conf.js'."
},
"env": {
"description": "Environment to pass if your config file returns a function",
"oneOf": [{ "type": "object" }, { "type": "string" }]
},
"arguments": {
"type": "object",
"description": "Arguments to pass if your config file returns a function. E.g. {mode: 'production'} if you want to use webpack 4's 'mode' feature"
}
}
},
"enhancedResolveOptions": {
"type": "object",
"additionalProperties": false,
"description": "Options used in module resolution that for dependency-cruiser's use cannot go in a webpack config. For details please refer to the documentation of enhanced-resolve itself.",
"properties": {
"exportsFields": {
"type": "array",
"description": "List of strings to consider as 'exports' fields in package.json. Use ['exports'] when you use packages that use such a field and your environment supports it (e.g. node ^12.19 || >=14.7 or recent versions of webpack).",
"items": { "type": "string" }
},
"conditionNames": {
"type": "array",
"description": "List of conditions to check for in the exports field. e.g. use `['imports']` if you're only interested in exposed es6 modules, ['require'] for commonjs, or all conditions at once (['import', 'require', 'node', 'default']) if anything goes for you. Only works when the 'exportsFields' array is non-empty",
"items": { "type": "string" }
},
"extensions": {
"type": "array",
"description": "List of extensions to scan for when resolving. Typically you want to leave this alone as dependency-cruiser figures out what extensions to scan based on 1. what is available in your environment 2. in the order your environment (nodejs, typescript) applies the resolution itself. However, if you want it to scan less you can specify so with the extensions attribute. E.g. when you're 100% sure you _only_ have typescript & json and nothing else you can pass ['.ts', '.json'] - which can lead to performance gains on systems with slow i/o (like ms-windows), especially when your tsconfig contains paths/ aliases.",
"items": { "type": "string" }
},
"mainFields": {
"type": "array",
"description": "A list of main fields in manifests (package.json s). Typically you'd want to keep leave this this on its default (['main']) , but if you e.g. use external packages that only expose types, and you still want references to these types to be resolved you could expand this to ['main', 'types', 'typings']",
"items": { "type": "string" }
},
"mainFiles": {
"type": "array",
"description": "A list of files to consider 'main' files, defaults to ['index']. Only set this when you have really special needs that warrant it."
},
"aliasFields": {
"type": "array",
"description": "A list of alias fields in manifests (package.jsons). Specify a field, such as browser, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). Also see [resolve.alias](https://webpack.js.org/configuration/resolve/#resolvealiasfields) in the webpack docs. Defaults to an empty array (don't use any alias fields).",
"items": { "type": "string" }
},
"cachedInputFileSystem": {
"type": "object",
"description": "Options to pass to the resolver (webpack's 'enhanced resolve') regarding caching.",
"additionalProperties": false,
"properties": {
"cacheDuration": {
"type": "integer",
"minimum": 0,
"maximum": 1800000,
"description": "The number of milliseconds [enhanced-resolve](webpack/enhanced-resolve)'s cached file system should use for cache duration. Typically you won't have to touch this - the default works well for repos up to 5000 modules/ 20000 dependencies, and likely for numbers above as well. If you experience memory problems on a (humongous) repository you can use the cacheDuration attribute to tame enhanced-resolve's memory usage by lowering the cache duration trading off against some (for values over 1000ms) or significant (for values below 500ms) performance. Dependency-cruiser currently uses 4000ms, and in the past has used 1000ms - both with good results."
}
}
}
}
},
"babelConfig": {
"type": "object",
"additionalProperties": false,
"description": "Babel configuration (e.g. '.babelrc.json') to use.",
"properties": {
"fileName": {
"description": "The Babel configuration file to use. The fileName is relative to dependency-cruiser's current working directory. When not provided defaults to './.babelrc.json'. Dependency-cruiser currently supports only the json variant. Support for (js|cjs|mjs) variants and configuration in package.json might follow in future releases.",
"type": "string"
}
}
},
"parser": {
"type": "string",
"description": "overrides the parser dependency-cruiser will use - EXPERIMENTAL. The use of 'swc' as a parser here is deprecated.",
"enum": ["acorn", "tsc", "swc"]
},
"exoticRequireStrings": {
"type": "array",
"description": "List of strings you have in use in addition to cjs/ es6 requires & imports to declare module dependencies. Use this e.g. if you've re-declared require (`const want = require`), use a require-wrapper (like semver-try-require) or use window.require as a hack to workaround something",
"items": { "type": "string" }
},
"reporterOptions": { "$ref": "#/definitions/ReporterOptionsType" },
"progress": {
"type": "object",
"additionalProperties": false,
"description": "How dependency-cruiser shows progress. Defaults to 'none'.",
"properties": {
"type": {
"type": "string",
"enum": ["cli-feedback", "performance-log", "ndjson", "none"]
},
"maximumLevel": {
"description": "The maximum log level to emit messages at. Ranges from OFF (-1, don't show any messages), via SUMMARY (40), INFO (50), DEBUG (60) all the way to show ALL messages (99).",
"type": "number",
"enum": [-1, 40, 50, 60, 70, 80, 99]
}
}
},
"metrics": {
"type": "boolean",
"description": "When this flag is set to true, dependency-cruiser will calculate (stability) metrics for all modules and folders. Defaults to false."
},
"experimentalStats": {
"type": "boolean",
"description": "When this flag is set to true, dependency-cruiser will calculate some stats for each module. Has some performance impact. EXPERIMENTAL Will be renamed when the 'experimental' state is lifted. Defaults to false."
},
"skipAnalysisNotInRules": {
"type": "boolean",
"description": "When this flag is set to true, dependency-cruiser will skip all analysis that don't serve a rule. E.g. if there's no 'circular' rule in the rule set it won't analyse cycles. This flag affects cycle, dependents and orphan analysis. If you have a rule set that doesn't use one of these features, switching it to true will make cruises faster. Defaults to false for backwards compatibility. For most uses of dependency-cruiser we recommend to switch this option to true, though."
},
"baseDir": {
"type": "string",
"description": "The directory dependency-cruiser should run its cruise from. Defaults to the current working directory."
},
"cache": {
"oneOf": [
{ "type": "boolean" },
{ "deprecated": true, "type": "string" },
{ "$ref": "#/definitions/CacheOptionsType" }
],
"description": "- false: don't use caching. \n- true or empty object: use caching with the default settings \n- a string (deprecated): cache in the folder denoted by the string & use the \n default caching strategy. This is deprecated - instead pass a cache object \n e.g. ```{ folder: 'your/cache/location' }```.\n\nDefaults to false (no caching).\nWhen caching is switched on the default cache folder is 'node_modules/.cache/dependency-cruiser/'"
}
}
},
"ModuleSystemType": {
"type": "string",
"enum": ["cjs", "es6", "amd", "tsd"]
},
"ModuleSystemsType": {
"type": "array",
"description": "List of module systems to cruise. Defaults to [amd, cjs, es6]",
"items": { "$ref": "#/definitions/ModuleSystemType" }
},
"CompoundExcludeType": {
"type": "object",
"description": "Criteria for dependencies to exclude",
"additionalProperties": false,
"properties": {
"path": {
"description": "a regular expression for modules to exclude from being cruised",
"$ref": "#/definitions/REAsStringsType"
},
"dynamic": {
"type": "boolean",
"description": "a boolean indicating whether or not to exclude dynamic dependencies"
}
}
},
"CompoundDoNotFollowType": {
"type": "object",
"description": "Criteria for modules to include, but not to follow further",
"additionalProperties": false,
"properties": {
"path": {
"description": "a regular expression for modules to include, but not follow further",
"$ref": "#/definitions/REAsStringsType"
},
"dependencyTypes": {
"type": "array",
"description": "an array of dependency types to include, but not follow further",
"items": { "$ref": "#/definitions/DependencyTypeType" }
}
}
},
"CompoundIncludeOnlyType": {
"type": "object",
"description": "Criteria for modules to only include",
"additionalProperties": false,
"properties": {
"path": {
"description": "dependency-cruiser will include modules matching this regular expression in its output, as well as their neighbours (direct dependencies and dependents)",
"$ref": "#/definitions/REAsStringsType"
}
}
},
"CompoundFocusType": {
"type": "object",
"description": "Criteria for modules to 'focus' on",
"additionalProperties": false,
"properties": {
"path": {
"description": "dependency-cruiser will include modules matching this regular expression in its output, as well as their neighbours (direct dependencies and dependents)",
"$ref": "#/definitions/REAsStringsType"
},
"depth": {
"description": "by default 'focus' only inlcudes the direct neighbours of the focus'ed module(s). This property makes dependency-cruiser will also include neighbors of neighbors, up to the specified depth.",
"type": "number",
"minimum": 1,
"maximum": 4
}
}
},
"CompoundReachesType": {
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"description": "dependency-cruiser will include modules matching this regular expression in its output, as well as _any_ module that reaches them - either directly or via via",
"$ref": "#/definitions/REAsStringsType"
}
}
},
"CompoundHighlightType": {
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"description": "dependency-cruiser will mark modules matching this regular expression as 'highlighted' in its output",
"$ref": "#/definitions/REAsStringsType"
}
}
},
"ReporterOptionsType": {
"type": "object",
"description": "Options to tweak the output of reporters",
"additionalProperties": false,
"properties": {
"anon": { "$ref": "#/definitions/AnonReporterOptionsType" },
"archi": { "$ref": "#/definitions/DotReporterOptionsType" },
"dot": { "$ref": "#/definitions/DotReporterOptionsType" },
"ddot": { "$ref": "#/definitions/DotReporterOptionsType" },
"flat": { "$ref": "#/definitions/DotReporterOptionsType" },
"markdown": { "$ref": "#/definitions/MarkdownReporterOptionsType" },
"metrics": { "$ref": "#/definitions/MetricsReporterOptionsType" },
"mermaid": { "$ref": "#/definitions/MermaidReporterOptionsType" },
"text": { "$ref": "#/definitions/TextReporterOptionsType" }
}
},
"AnonReporterOptionsType": {
"type": "object",
"description": "Options to tweak the output of the anonymous reporter",
"additionalProperties": false,
"properties": {
"wordlist": {
"type": "array",
"description": "List of words to use to replace path elements of file names in the output with so the output isn't directly traceable to its intended purpose. When the list is exhausted, the anon reporter will use random strings patterned after the original file name in stead. The list is empty by default. Read more in https://github.com/sverweij/dependency-cruiser/blob/main/doc/cli.md#anon---obfuscated-json",
"items": { "type": "string" }
}
}
},
"MetricsReporterOptionsType": {
"type": "object",
"description": "Options to tweak the output of the metrics reporter",
"additionalProperties": false,
"properties": {
"orderBy": {
"type": "string",
"enum": [
"instability",
"moduleCount",
"afferentCouplings",
"efferentCouplings",
"name",
"size",
"topLevelStatementCount"
],
"description": "By what attribute (in addition to the names of the folders/ modules) to order the metrics by. Defaults to 'instability'."
},
"hideModules": {
"type": "boolean",
"description": "When true hides module metrics from the report. Defaults to false"
},
"hideFolders": {
"type": "boolean",
"description": "When true hides folder metrics from the report. Defaults to false"
}
}
},
"MarkdownReporterOptionsType": {
"type": "object",
"description": "Options to show and hide sections of the markdown reporter and to provide alternate boilerplate text",
"additionalProperties": false,
"properties": {
"showTitle": {
"type": "boolean",
"description": "Whether or not to show a title in the report. Defaults to true."
},
"title": {
"type": "string",
"description": "The text to show as a title of the report. E.g. '## dependency-cruiser forbidden dependency check - results'. When left out shows a default value."
},
"showSummary": {
"type": "boolean",
"description": "Whether or not to show a summary in the report. Defaults to true."
},
"showSummaryHeader": {
"type": "boolean",
"description": "Whether or not to give the summary a header. Defaults to true."
},
"summaryHeader": {
"type": "string",
"description": "The text to show as a header on top of the summary. E.g. '### Summary'. When left out shows a default value."
},
"showStatsSummary": {
"type": "boolean",
"description": "Whether or not to show high level stats in the summary. Defaults to true."
},
"showRulesSummary": {
"type": "boolean",
"description": "Whether or not to show a list of violated rules in the summary. Defaults to true."
},
"includeIgnoredInSummary": {
"type": "boolean",
"description": "Whether or not to show rules in the list of rules for which all violations are ignored. Defaults to true."
},
"showDetails": {
"type": "boolean",
"description": "Whether or not to show a detailed list of violations. Defaults to true."
},
"includeIgnoredInDetails": {
"type": "boolean",
"description": "Whether or not to show ignored violations in the detailed list. Defaults to true."
},
"showDetailsHeader": {
"type": "boolean",
"description": "Whether or not to give the detailed list of violations a header. Defaults to true."
},
"detailsHeader": {
"type": "string",
"description": "The text to show as a header on top of the detailed list of violations. E.g. '### All violations'. When left out shows a default value."
},
"collapseDetails": {
"type": "boolean",
"description": "Whether or not to collapse the list of violations in a <details> block. Defaults to true."
},
"collapsedMessage": {
"type": "string",
"description": "The text to in the <summary> section of the <details> block. E.g. 'click to see all violations'. When left out shows a default value."
},
"noViolationsMessage": {
"type": "string",
"description": "The text to show when no violations were found. E.g. 'No violations found'. When left out shows a default value."
},
"showFooter": {
"type": "boolean",
"description": "Whether or not to show a footer (with version & run date) at the bottom of the report. Defaults to true"
}
}
},
"MermaidReporterOptionsType": {
"type": "object",
"description": "Options to tweak the output of the mermaid reporters",
"additionalProperties": false,
"properties": {
"minify": {
"type": "boolean",
"description": "Whether or not to compresses the output text. Defaults to true."
}
}
},
"TextReporterOptionsType": {
"type": "object",
"description": "Options that influence rendition of the text reporter",
"additionalProperties": false,
"properties": {
"highlightFocused": {
"type": "boolean",
"description": "Whether or not to highlight modules that are focused with the --focus command line option (/ general option). Defaults to false"
}
}
},
"DotReporterOptionsType": {
"type": "object",
"description": "Options to tweak the output of the dot reporters",
"additionalProperties": false,
"properties": {
"collapsePattern": {
"description": "Regular expressions to collapse to. For the \"dot\" reporter defaults to null, but \"node_modules/[^/]+\" is recommended for most use cases.",
"$ref": "#/definitions/REAsStringsType"
},
"filters": { "$ref": "#/definitions/ReporterFiltersType" },
"showMetrics": {
"description": "When passed the value 'true', shows instability metrics in the output if dependency-cruiser calculated them. Doesn't show them in all other cases. Defaults to false",
"type": "boolean"
},
"theme": { "$ref": "#/definitions/DotThemeType" }
}
},
"DotThemeType": {
"type": "object",
"description": "A bunch of criteria to conditionally theme the dot output",
"additionalProperties": false,
"properties": {
"replace": {
"type": "boolean",