🚀Announcing Flightcontrol - Optimized Deployment for Fullstack Blitz.js and Next.js 🚀
Back to Documentation Menu

Custom Husky Config

Topics

Jump to a Topic

Husky is a tool that helps improve your commits.

You can use it to lint your commit messages, run tests, lint code, and more when you commit or push using Git hooks.

For example, a pre-commit hook is triggered right before a commit is created.

Default Blitz config

By default, new Blitz apps install a pre-commit and pre-push hook inside .husky/ in the project root. You can view these hooks here.

Husky is installed after you use NPM or Yarn to install your dependencies following this instruction in the package.json file:

{
  "scripts": {
    "prepare": "husky install"
  }
}

Note that if you use Yarn 2, Husky needs to be installed differently. Yarn 2 doesn't support the prepare lifecycle script. See Yarn 2 install.

Troubleshooting Husky

If you are having problems commiting or pushing, check out the Husky troubleshooting guide.

To optionally bypass checks, you can run git commit -m "message" --no-verify or git push --no-verify.


Idea for improving this page? Edit it on GitHub.