"Please add your rules to your `commitlint.config.js`" when using @commitlint/config-conventional

See original GitHub issue

Expected Behavior

commitlint to utilize the node module @commitlint/config-conventional when performing git commit and after having created a commitlint.config.js file that extends config-conventional: echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js

Current Behavior

husky > commit-msg (node v12.16.1)
⧗   input: refactor: remove old files, add dev files
✖   Please add rules to your `commitlint.config.js`
    - Getting started guide: https://git.io/fhHij
    - Example config: https://git.io/fhHip [empty-rules]

✖   found 1 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

husky > commit-msg hook failed (add --no-verify to bypass)

Affected packages

  • cli

Steps to Reproduce (for bugs)

Follow the instructions here: https://commitlint.js.org/#/guides-local-setup

Don’t add any additional rules to commitlint.config.js and attempt a git commit.

Your Environment

Windows 10 Pro 19041

Executable Version
commitlint --version 9.0.1
git --version 2.27.0.windows.1
node --version 12.16.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Zirakcommented, Jan 13, 2022

Tried reproducing without success:

$ npm i @commitlint/cli @commitlint/config-conventional

# from original comment
$ echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js

# sample commit message from original comment
$ echo 'refactor: remove old files, add dev files' | npx commitlint -V
⧗   input: refactor: remove old files, add dev files
✔   found 0 problems, 0 warnings

$ npx commitlint --version
@commitlint/cli@16.0.2
0reactions
guijianghengcommented, Dec 26, 2021

@escapedcat You might create a .commitlint.config.js instead of commitlint.config.js, you might use a wrong filename just like me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when used with Husky: "Please add rules to ... - GitHub
Today I started getting the following error: Please add rules to your commitlint.config.js. I have never needed this file before!
Read more >
Am unable to "Git Commit" my project onto my Github
Remove the commitlint node package from package.json or the dependent and rerun install or add a commitlint.config.js to the base of your ......
Read more >
commitlint - Lint commit messages
commitlint helps your team adhere to a commit convention. By supporting npm-installed configurations it makes sharing of commit conventions easy.
Read more >
Setting up commitlint and husky with a new project
Following that I attempted to commit a bad commit message. The following error showed, Please add rules to your commitlint.config. · Add the...
Read more >
@commitlint/config-conventional - npm
Start using @commitlint/config-conventional in your project by running `npm i ... The following rules are considered problems for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found