Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/remarkablemark/husky-4-to-5
:dog: Migrate husky from 4 to 9.
https://github.com/remarkablemark/husky-4-to-5
binary cli config husky javascript migration nodejs npm typescript upgrade
Last synced: 2 months ago
JSON representation
:dog: Migrate husky from 4 to 9.
- Host: GitHub
- URL: https://github.com/remarkablemark/husky-4-to-5
- Owner: remarkablemark
- License: mit
- Created: 2021-02-28T20:46:56.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-30T05:04:58.000Z (8 months ago)
- Last Synced: 2024-05-01T21:25:40.603Z (8 months ago)
- Topics: binary, cli, config, husky, javascript, migration, nodejs, npm, typescript, upgrade
- Language: TypeScript
- Homepage: https://npmjs.com/package/husky-4-to-5
- Size: 1.43 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# husky-4-to-5
[![NPM](https://nodei.co/npm/husky-4-to-5.png)](https://nodei.co/npm/husky-4-to-5/)
[![NPM version](https://img.shields.io/npm/v/husky-4-to-5.svg)](https://www.npmjs.com/package/husky-4-to-5)
[![build](https://github.com/remarkablemark/husky-4-to-5/actions/workflows/build.yml/badge.svg)](https://github.com/remarkablemark/husky-4-to-5/actions/workflows/build.yml):dog: Migrate [husky](https://typicode.github.io/husky/) from 4 to 9.
```sh
npx husky-4-to-5
```Alternatively, there's [typicode/husky-4-to-8](https://github.com/typicode/husky-4-to-8) (requires npm 7+).
## Install
### Global
Install with npm:
```sh
npm install --global husky-4-to-5
```Install with yarn:
```sh
yarn global add husky-4-to-5
```## Usage
If the CLI is installed globally, you can execute it in the command-line:
```sh
husky-4-to-5
```Otherwise, you can install and execute the CLI like so:
```sh
npx husky-4-to-5
```## Explanation
The script:
- updates `package.json` scripts:
- prepends `husky` to `prepare`
- installs devDependency:
- [husky](https://www.npmjs.com/package/husky)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:
```sh
jest → npx jest
→ yarn jestjest && eslint → npx jest && npx eslint
→ yarn jest && yarn eslintcommitlint -E HUSKY_GIT_PARAMS → npx commitlint --edit $1
→ yarn commitlint --edit $1
```## Lint
Lint files:
```sh
npm run lint
```Fix lint errors:
```sh
npm run lint:fix
```## Release
Release and publish are automated with [Release Please](https://github.com/googleapis/release-please).
## License
[MIT](https://github.com/remarkablemark/husky-4-to-5/blob/master/LICENSE)