MCPcopy Create free account
hub / github.com/conventional-changelog/commitlint / loadFormatter

Function loadFormatter

@commitlint/cli/src/cli.ts:589–598  ·  view source on GitHub ↗
(config: QualifiedConfig, flags: CliFlags)

Source from the content-addressed store, hash-verified

587}
588
589function loadFormatter(config: QualifiedConfig, flags: CliFlags): Promise<Formatter> {
590 const moduleName = flags.format || config.formatter || "@commitlint/format";
591 const modulePath = resolveModulePath(moduleName, flags);
592
593 if (modulePath) {
594 return dynamicImport<Formatter>(modulePath);
595 }
596
597 throw new Error(`Using format ${moduleName}, but cannot find the module.`);
598}
599
600// Catch unhandled rejections globally
601process.on("unhandledRejection", (reason, promise) => {

Callers 1

mainFunction · 0.85

Calls 2

resolveModulePathFunction · 0.85
dynamicImportFunction · 0.70

Tested by

no test coverage detected