Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add validator run event to allow plugins to perform custom validation #2184

Merged
merged 2 commits into from Feb 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/application-events.ts
@@ -1,3 +1,4 @@
export const ApplicationEvents = {
BOOTSTRAP_END: "bootstrapEnd",
VALIDATE_PROJECT: "validateProject",
};
8 changes: 8 additions & 0 deletions src/lib/application.ts
Expand Up @@ -107,6 +107,12 @@ export class Application extends ChildableComponent<
*/
static readonly EVENT_BOOTSTRAP_END = ApplicationEvents.BOOTSTRAP_END;

/**
* Emitted when validation is being run.
* The listener will be given an instance of {@link ProjectReflection}.
*/
static readonly EVENT_VALIDATE_PROJECT = ApplicationEvents.VALIDATE_PROJECT;

/**
* Create a new TypeDoc application instance.
*/
Expand Down Expand Up @@ -431,6 +437,8 @@ export class Application extends ChildableComponent<
validateLinks(project, this.logger);
}

this.trigger(Application.EVENT_VALIDATE_PROJECT, project);

this.logger.verbose(`Validation took ${Date.now() - start}ms`);
}

Expand Down