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

Use husky.hooks to prevent warning on commit #830

Merged
merged 2 commits into from
Aug 13, 2018
Merged

Use husky.hooks to prevent warning on commit #830

merged 2 commits into from
Aug 13, 2018

Conversation

richdouglasevans
Copy link
Contributor

Fixes an issue that caused the following warning to appear every time I committed in this repository.

Warning: Setting pre-commit script in package.json > scripts will be deprecated in v1.0
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

The issue was this pre-commit script: I've just done what the docs said to do and now there's no warning and the pre-commit hook is still run.

~/cypress/docs >> fix/husky >> git commit -am wip
husky > pre-commit (node v10.7.0)

> cypress-documentation@0.0.0 lint /Users/evansr1/cypress/docs
> echo 'Linting scripts...' && eslint --fix *.js cy_scripts/*.js scripts/*.js && echo 'Lint successful'

Linting scripts...
Lint successful
[fix/husky 54baaf4] wip
 1 file changed, 1 deletion(-)

"hooks": {
"pre-commit": "npm run lint"
}
},
"jest": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used an explicit husky section in the existing package.json 'cos of the precedent established by the explicit section for jest.

Copy link
Contributor

@bahmutov bahmutov left a comment

Choose a reason for hiding this comment

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

sure, looks good and will keep husky up to date

@jennifer-shehane jennifer-shehane merged commit a7efc81 into cypress-io:develop Aug 13, 2018
@richdouglasevans richdouglasevans deleted the fix/husky branch August 13, 2018 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants