husky-4-to-5

1.5.0 • Public • Published

husky-4-to-5

NPM

NPM version build

🐶 Migrate husky from 4 to 9.

npx husky-4-to-5

Alternatively, there's typicode/husky-4-to-8 (requires npm 7+).

Install

Global

Install with npm:

npm install --global husky-4-to-5

Install with yarn:

yarn global add husky-4-to-5

Usage

If the CLI is installed globally, you can execute it in the command-line:

husky-4-to-5

Otherwise, you can install and execute the CLI like so:

npx husky-4-to-5

Explanation

The script:

  • updates package.json scripts:
    • prepends husky to prepare
  • installs devDependency:

Finally, the script adds the hooks from one of the config files:

  • .huskyrc
  • .huskyrc.json
  • .huskyrc.js
  • husky.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 $1

Lint

Lint files:

npm run lint

Fix lint errors:

npm run lint:fix

Release

Release and publish are automated with Release Please.

License

MIT

/husky-4-to-5/

    Package Sidebar

    Install

    npm i husky-4-to-5

    Weekly Downloads

    8

    Version

    1.5.0

    License

    MIT

    Unpacked Size

    9.93 kB

    Total Files

    11

    Last publish

    Collaborators

    • remarkablemark