Open bf opened 1 year ago
It seems that echo "feat: asdasd" | npx --yes commitlint -x @commitlint/config-conventional --verbose
works. The cli docs are a bit misleading at https://commitlint.js.org/#/reference-cli
The default npx --yes commitlink should just work in my opinion.
Doubt we gonna fix this. But happy for a PR to adjust the docs.
I assume it might work with at least a commitlint-config (i.e. commitlint.config.js
) but not sure.
Thanks for quick reply. Is there any way to run commitlint via npx without installing the @commitlint/config-conventional package via npm beforehand? It's so weird that the cli does not come with a default config!
Ah, sorry, see my updated comment above.
It's a bit weird, because my use case is to configure git to have a pre-receive hook that checks for properly formatted commit messages with commitlint. I want to run npx --yes commitlint
so it downloads commitlint and stores it in a temp folder, but does not create any node_modules/ or package.json files.
As npx --yes commitlint
only works with npx --yes commitlint -x @commitlint/config-conventional
there needs to be a node_modules folder in near the git pre-receive hook which is not ideal.
Is nobody using commitlint in the git pre-receive? When I use it in a github action, the commit is already pushed to the repo and the damage is done.
Expected Behavior
use default config and dont throw error
Current Behavior
Affected packages
Possible Solution
load default config
Steps to Reproduce
Context
https://commitlint.js.org/#/guides-local-setup?id=test-simple-usage says "For a first simple usage test of commitlint you can do the following:
npx commitlint --from HEAD~1 --to HEAD --verbose
" but if you adapt it to read from stdin it does not work.commitlint --version
@commitlint/cli@17.7.1
git --version
git version 2.42.0
node --version
v20.5.1