feat(commitlint): add additional search path for @commitlint

This change allows opencommit to locate commitlint installed globally
(with opencommit), which is useful for project that does not use node.js
environment or dose not have opencommit and @commitlint installed locally.
This commit is contained in:
Jethro Yu
2025-03-17 11:42:54 +08:00
parent 7feb3ec00e
commit 44bd14d2c5

View File

@@ -4,7 +4,8 @@ import path from 'path';
const findModulePath = (moduleName: string) => {
const searchPaths = [
path.join('node_modules', moduleName),
path.join('node_modules', '.pnpm')
path.join('node_modules', '.pnpm'),
path.resolve(__dirname, '../..')
];
for (const basePath of searchPaths) {