@@ -32,10 +32,8 @@ import {
32
32
} from "./utils/entry-point" ;
33
33
import { nicePath } from "./utils/paths" ;
34
34
import { getLoadedPaths , hasBeenLoadedMultipleTimes } from "./utils/general" ;
35
- import { validateExports } from "./validation/exports" ;
36
- import { validateDocumentation } from "./validation/documentation" ;
37
- import { validateLinks } from "./validation/links" ;
38
35
import { ApplicationEvents } from "./application-events" ;
36
+ import { Validator } from "./validation/validator" ;
39
37
40
38
// eslint-disable-next-line @typescript-eslint/no-var-requires
41
39
const packageInfo = require ( "../../package.json" ) as {
@@ -75,6 +73,11 @@ export class Application extends ChildableComponent<
75
73
*/
76
74
renderer : Renderer ;
77
75
76
+ /**
77
+ * The validator used to valid documentation.
78
+ */
79
+ validator : Validator ;
80
+
78
81
/**
79
82
* The serializer used to generate JSON output.
80
83
*/
@@ -119,6 +122,7 @@ export class Application extends ChildableComponent<
119
122
this . serializer = new Serializer ( ) ;
120
123
this . converter = this . addComponent < Converter > ( "converter" , Converter ) ;
121
124
this . renderer = this . addComponent < Renderer > ( "renderer" , Renderer ) ;
125
+ this . validator = this . addComponent < Validator > ( "validator" , Validator ) ;
122
126
}
123
127
124
128
/**
@@ -408,30 +412,7 @@ export class Application extends ChildableComponent<
408
412
}
409
413
410
414
validate ( project : ProjectReflection ) {
411
- const checks = this . options . getValue ( "validation" ) ;
412
- const start = Date . now ( ) ;
413
-
414
- if ( checks . notExported ) {
415
- validateExports (
416
- project ,
417
- this . logger ,
418
- this . options . getValue ( "intentionallyNotExported" )
419
- ) ;
420
- }
421
-
422
- if ( checks . notDocumented ) {
423
- validateDocumentation (
424
- project ,
425
- this . logger ,
426
- this . options . getValue ( "requiredToBeDocumented" )
427
- ) ;
428
- }
429
-
430
- if ( checks . invalidLink ) {
431
- validateLinks ( project , this . logger ) ;
432
- }
433
-
434
- this . logger . verbose ( `Validation took ${ Date . now ( ) - start } ms` ) ;
415
+ this . validator . validate ( project ) ;
435
416
}
436
417
437
418
/**
0 commit comments