Steps to Reproduce
1. Create an empty folder and `cd` into it
2. `npm install -D @commitlint/cli @commitlint/config-conventional`
3. npx commitlint --to doesNotMatter -d doesNotExist
Current Behavior
commitlint does nothing at all and returns with exit code 0 (=zero).
Expected Behavior
commitlint logs an error, that the given working directory cannot be found and returns with a non-zero exit code.
Affected packages
Possible Solution
If a working directory is explicitly given with -d or --cwd, validate the directory actually exists and if not error out.
Context
I think it is bad default behavior for a linter to accept invalid working directory as parameter and just silently ignore it and do nothing at all.
commitlint --version
@commitlint/[email protected]
git --version
irrelevant
node --version
v24.11.1
Steps to Reproduce
Current Behavior
commitlint does nothing at all and returns with exit code 0 (=zero).
Expected Behavior
commitlint logs an error, that the given working directory cannot be found and returns with a non-zero exit code.
Affected packages
Possible Solution
If a working directory is explicitly given with
-dor--cwd, validate the directory actually exists and if not error out.Context
I think it is bad default behavior for a linter to accept invalid working directory as parameter and just silently ignore it and do nothing at all.
commitlint --version
@commitlint/[email protected]
git --version
irrelevant
node --version
v24.11.1