New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How does husky manage shared folder configuration #1248
Comments
@typicode Looking forward to your help |
Git only has one hooks directory so you can't have natively multiple places where hooks are stored. The recommended approach is to have husky in root and let monorepo tools run scripts. So for example, in |
@typicode 但是在package.json中无法直接使用 |
Is there a way to put the SH file on NPM and use it in the project, can you give a DEMO? |
Sorry I probably won't have time right now to go into details, but I hope to be able to make a blog post or add docs at some points. // my-script.js
const yourHooks = require('your-hooks') // your hooks is a published package on npm
const husky = require('husky')
husky.install()
// loop through your hooks and do something like run husky.set('.husky/pre-commit', yourHooks.preCommit) In your package.json "scripts": {
"prepare": "node my-script"
} |
@typicode |
Currently husky is one in each project.husky directory,
With more and more projects, copying directories can cause a lot of trouble. Is there a way to share.husky directories
The text was updated successfully, but these errors were encountered: