Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update husky to 8.0.3 #159

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

MikeMcC399
Copy link
Collaborator

@MikeMcC399 MikeMcC399 commented Apr 10, 2024

Issue

When committing to the repo, the Husky hook outputs a deprecation message:

Warning: Setting pre-commit script in package.json > scripts will be deprecated
Please move it to husky.hooks in package.json, a .huskyrc file, or a husky.config.js file
Or run ./node_modules/.bin/husky-upgrade for automatic update

and an npm support warning message such as:

husky > pre-commit (node v16.15.0)
npm WARN npm npm does not support Node.js v16.15.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11, 12.
npm WARN npm You can find the latest version at https://nodejs.org/

Changes

(CI is still running on Node.js 16 and the latest version of Husky (9.x) requires Node.js "node": ">=18".)

Detail steps

npm install husky@8 -D
npx husky install
npm pkg set scripts.prepare="husky install"
npx husky add .husky/pre-commit "npm run lint"

Remove "precommit": "npm run lint", from package.json

Verification

Ubuntu 22.04.4 LTS, Node.js 16.15.0

git clone https://github.com/cypress-io/eslint-plugin-cypress
cd eslint-plugin-cypress
npm ci
touch dummy.txt
git add .
git commit -m "commit dummy.txt"

Check that there are no warnings. The output should be similar to the following:

$ git commit -m "commit dummy.txt"

> eslint-plugin-cypress@0.0.0-development lint
> eslint '*.js' '**/**/*.js'

[test/husky 14e9c96] commit dummy.txt
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 dummy.txt

References

husky@8.0.3 documentation is on https://github.com/typicode/husky/tree/v8.0.3/docs

@CLAassistant
Copy link

CLAassistant commented Apr 10, 2024

CLA assistant check
All committers have signed the CLA.

@cypress-app-bot
Copy link

@MikeMcC399 MikeMcC399 marked this pull request as ready for review April 10, 2024 16:24
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for updating!

@jennifer-shehane jennifer-shehane merged commit 0b6ec16 into cypress-io:master Apr 12, 2024
9 checks passed
@MikeMcC399
Copy link
Collaborator Author

@jennifer-shehane

I may be out of my depth to try and completely update this plugin. I will see how far I can get anyway.

@MikeMcC399 MikeMcC399 deleted the update/husky-to-8 branch April 12, 2024 15:42
@jennifer-shehane
Copy link
Member

@MikeMcC399 Any little updates help

@cypress-app-bot
Copy link

🎉 This PR is included in version 2.15.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants