husky-4-to-5
v1.5.2
Published
Migrates husky 4 to 9.
Downloads
24
Maintainers
Readme
husky-4-to-5
:dog: Migrate husky from 4 to 9.
npx husky-4-to-5Alternatively, there's typicode/husky-4-to-8 (requires npm 7+).
Install
Global
Install with npm:
npm install --global husky-4-to-5Install with yarn:
yarn global add husky-4-to-5Usage
If the CLI is installed globally, you can execute it in the command-line:
husky-4-to-5Otherwise, you can install and execute the CLI like so:
npx husky-4-to-5Explanation
The script:
- updates
package.jsonscripts:- prepends
huskytoprepare
- prepends
- installs devDependency:
Finally, the script adds the hooks from one of the config files:
.huskyrc.huskyrc.json.huskyrc.jshusky.config.js
The config file will be removed and changes to the repository will be committed.
Hooks may need to be manually updated to be run via the package manager. For example:
jest → npx jest
→ yarn jest
jest && eslint → npx jest && npx eslint
→ yarn jest && yarn eslint
commitlint -E HUSKY_GIT_PARAMS → npx commitlint --edit $1
→ yarn commitlint --edit $1Lint
Lint files:
npm run lintFix lint errors:
npm run lint:fixRelease
Release and publish are automated with Release Please.

