diff --git a/docs/how-to.md b/docs/how-to.md index 72ec79d7..2ca15a58 100644 --- a/docs/how-to.md +++ b/docs/how-to.md @@ -68,14 +68,13 @@ Modify the `prepare` script to never fail: You'll still get a `command not found` error message in your output which may be confusing. To make it silent, create `.husky/install.mjs`: + ```js // Skip Husky install in production and CI -import husky from 'husky' - -if (process.env.NODE_ENV === 'production' || process.env.CI === '1') { +if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') { process.exit(0) } - +const husky = (await import('husky')).default console.log(husky()) ``` @@ -190,7 +189,7 @@ Alternatively, if your shell startup file is fast and lightweight, source it dir ## Manual setup -Git needs to be configured and husky needs to setup files in `.husky/`. +Git needs to be configured and husky needs to setup files in `.husky/`. Run the `husky` command once in your repo. Ideally, include it in the `prepare` script in `package.json` for automatic execution after each install (recommended).