Skip to content

Commit

Permalink
fix: search for packages under commitlint
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
joshbolduc committed Jun 20, 2023
1 parent 0cda1b3 commit 713c899
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/loadLibrary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ export const tryLoadDynamicLibrary = <T>(
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}`);
Expand Down

0 comments on commit 713c899

Please sign in to comment.