(config: QualifiedConfig, flags: CliFlags)
| 542 | } |
| 543 | |
| 544 | function 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 |
| 556 | process.on("unhandledRejection", (reason, promise) => { |
no test coverage detected