Is the _ folder a MUST HAVE? #1578
Unanswered
GarfieldDeepClone
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi :)
I setup husky according to the "Get Started" guide here:
https://typicode.github.io/husky/get-started.html
My project structure is like this:
├── .git/
└── frontend/ # Package.json with husky
the init created a husky structure here:
frontend/.husky with a pre-commit file in it.
Because of the structure I changed the prepare script in package.json to:
"prepare": "cd .. && husky frontend/.husky"
and in my pre-commit file:
lintstagedrc.json:
{ "*.{js,ts,vue,html,css,scss,json}": "prettier --write" }
When I run
npm run prepare
it creates a frontend/.husky/_ folder with dozens of hooks in it. Why? Why doesn't this happen already with thehusky init
command? Do I nead frontend/.husky/pre-commit and frontend/.husky/_/pre-commit?It seems like the prepare script is also setting the core.hooksPath always back to ui.frontend/.husky/_
So I don't understand why I need the prepare script and this _ folder? But it doesn't work without, when I change
core.hooksPath
to just frontend/.husky/ and deleting the _ folder I get this error message when commiting:error: cannot spawn ui.frontend/.husky/pre-commit: No such file or directory
So my question is -> is this _ folder a MUST HAVE?
Beta Was this translation helpful? Give feedback.
All reactions