question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when used with Husky: "Please add rules to your commitlint.config.js"

See original GitHub issue

Expected Behavior

The following Husky hook used to work perfectly with “@commitlint/cli”: “^7.2.1” and “husky”: “^1.2.1”

  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  },

Current Behavior

Today I started getting the following error:

Please add rules to your commitlint.config.js

I have never needed this file before!

image

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

I added the commitlint.config.js file to fix the problem, but it seems mysterious how this started appearing suddenly.

Note: I do not understand how HUSKY_GIT_PARAMS works. The husky documents do not quite explain it.

Steps to Reproduce (for bugs)

You can see my fixed project here: https://github.com/archfirst/joinjs. The previous commit did not work.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
AndresdoSantoscommented, Jun 7, 2022

Hi @escapedcat, were these versions…

{
    "@commitlint/cli": "^17.0.2",
    "@commitlint/config-conventional": "^17.0.2",
    "typescript": "^4.7.3",
}
1reaction
nareshbhatiacommented, Mar 10, 2019

Thanks for clarifying @marionebl. It makes total sense 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Am unable to "Git Commit" my project onto my Github
... add a commitlint.config.js to the base of your project as the error message ... Apparently you commit message do not meet requirements....
Read more >
Setting up commitlint and husky with a new project
The following error showed, Please add rules to your commitlint.config.js. Add the following to commitlint.config.js, which will extend the ...
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 >
How to lint Git commit messages - Husky - remarkablemark
This command installs both @commitlint/cli and @commitlint/config-conventional . config-conventional is a standard based on the Angular ...
Read more >
Set up ESLint, Prettier, Commitizen, Husky and friends in 2022
Next, we add a commitlint.config.js file to the root of our project. This works in a similar way to an ESLint config. We...
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