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

Function loadFormatter

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

Source from the content-addressed store, hash-verified

542}
543
544function loadFormatter(config: QualifiedConfig, flags: CliFlags): Promise<Formatter> {
545 const moduleName = flags.format || config.formatter || "@commitlint/format";
546 const modulePath = resolveModulePath(moduleName, flags);
547
548 if (modulePath) {
549 return dynamicImport<Formatter>(modulePath);
550 }
551
552 throw new Error(`Using format ${moduleName}, but cannot find the module.`);
553}
554
555// Catch unhandled rejections globally
556process.on("unhandledRejection", (reason, promise) => {

Callers 1

mainFunction · 0.85

Calls 2

resolveModulePathFunction · 0.85
dynamicImportFunction · 0.70

Tested by

no test coverage detected