From 713c8998afedad4bf8cd32e8a373ee52e57cc3db Mon Sep 17 00:00:00 2001 From: Josh Bolduc Date: Tue, 20 Jun 2023 09:24:11 -0400 Subject: [PATCH] fix: search for packages under `commitlint` Add `commitlint` to the set of paths under `node_modules` to search for dynamically loaded libraries, in addition to `@commitlint/cli`. This supports users who may have installed `commitlint` globally instead of `@commitlint/cli`. --- src/loadLibrary.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/loadLibrary.ts b/src/loadLibrary.ts index 399d030d..dc8851b9 100644 --- a/src/loadLibrary.ts +++ b/src/loadLibrary.ts @@ -27,7 +27,11 @@ export const tryLoadDynamicLibrary = ( if (path) { try { const resolvePath = require.resolve(name, { - paths: [path, resolve(path, '@commitlint', 'cli')], + paths: [ + path, + resolve(path, '@commitlint', 'cli'), + resolve(path, 'commitlint'), + ], }); log(`loading ${name} dynamically via ${resolvePath}`);