Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Conversation

@seVladimirs
Copy link

@seVladimirs seVladimirs commented Nov 23, 2021

  • adds instructions how to install husky with npm (and not with yarn only)
  • fixes typos in path to husky folder

@qmacro
Copy link
Contributor

qmacro commented Nov 23, 2021

Thanks for the PR, @seVladimirs ! Can you please add some description so we know what your intentions are with this? Thanks!

Comment on lines +15 to +20
### NPM
```
npx husky-init && npm install
```


Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've simple tried to execute instruction step by step without having yarn installed and failed. this fix will include also instructions for NPM

This sets up the formatter. Notice how it uses `set` over `add` as the second command does. This is because this was the first hook I was adding. The `set` command will overwrite all commands in the file. I also had the files format first and the unit tests run second. This is because regardless of if the unit tests pass or fail, I want my files to be formatted. If any of the commands error out, the commit will be aborted and no other hooks will be run, therefore, my unit tests are run last.
### Yarn
```
yarn husky set ./husky/pre-commit "npx pretty-quick --staged"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you execute this line it will fail as path to husky folder is wrong, it should be .husky instead.

@seVladimirs
Copy link
Author

@qmacro done, also commented directly in the code review

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants