(config: QualifiedConfig, flags: CliFlags)
| 587 | } |
| 588 | |
| 589 | function 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 |
| 601 | process.on("unhandledRejection", (reason, promise) => { |
no test coverage detected