Bug only happens after recent update (from @commitlint/[email protected] to @commitlint/[email protected]).
Before update: absolute paths to --config was treated properly (as absolute paths).
After update: absolute path in --config is treated as relative, so process.cwd() gets prepended to it and path becomes invalid, with error like this:
commitlint --config /Users/kirill/Idea/js-lib/node_modules/@naturalcycles/dev-lib/cfg/commitlint.config.js
/Users/kirill/Idea/js-lib/node_modules/@commitlint/cli/lib/cli.js:114
throw err;
^
Error: ENOENT: no such file or directory, open '/Users/kirill/Idea/js-lib/Users/kirill/Idea/js-lib/node_modules/@naturalcycles/dev-lib/cfg/commitlint.config.js'
I was running it from cwd of /Users/kirill/Idea/js-lib (as seen in the log above).
commitlint --config /Users/user/commitlist.config.jsError: ENOENT: no such file or directory, open '/Users/kirill/Idea/js-lib/Users/kirill/Idea/js-lib/node_modules/@naturalcycles/dev-lib/cfg/commitlint.config.js'
| Executable | Version |
| ---: | :--- |
| commitlint --version | VERSION |
7.6.0
| git --version | VERSION |
git version 2.20.1 (Apple Git-117)
| node --version | VERSION |
v10.15.3
Found the commit that probably introduced this issue: https://github.com/conventional-changelog/commitlint/pull/605/files#diff-6d0443e2b1ca53a84781bf18785f8f46R91
Fixed and released via @commitlint/[email protected]
thanks!
Most helpful comment
Fixed and released via
@commitlint/[email protected]