Husky add command is deprecated?
Asked Answered
E

2

6

I'm trying to follow this tutorial on how to add a commit msg hook with Husky.

And this is the command given in the tutorial:

npx husky add .husky/commit-msg 'npx commitlint --edit $1'

However when ran it errors with this message:

add command is deprecated

What should we be using instead of add?

Extragalactic answered 17/3 at 3:33 Comment(0)
F
0

Just create a file in .husky/commit-msg, and add this to the file:

npx commitlint --edit $1
Faint answered 14/8 at 14:41 Comment(0)
P
6

This tutorial has updated instructions.

To install husky just do:

npx husky init

Then install the commit msg file like this:

echo "npx --no -- commitlint --edit \$1" > .husky/commit-msg
Pithy answered 17/3 at 4:14 Comment(0)
F
0

Just create a file in .husky/commit-msg, and add this to the file:

npx commitlint --edit $1
Faint answered 14/8 at 14:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.