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).
Affected packages
Steps to Reproduce (for bugs)
commitlint --config /Users/user/commitlist.config.js
- See that it resolved wrongly, like:
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'
Your Environment
| 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 |
|
Bug only happens after recent update (from
@commitlint/[email protected]to@commitlint/[email protected]).Before update: absolute paths to
--configwas treated properly (as absolute paths).After update: absolute path in
--configis treated as relative, soprocess.cwd()gets prepended to it and path becomes invalid, with error like this:I was running it from
cwdof/Users/kirill/Idea/js-lib(as seen in the log above).Affected packages
Steps to Reproduce (for bugs)
commitlint --config /Users/user/commitlist.config.jsYour Environment
commitlint --version7.6.0git --versiongit version 2.20.1 (Apple Git-117)node --versionv10.15.3