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

Remove `grunt-githooks` and use `precommit` script in `package.json` #3155

Open
ProLoser opened this issue Jan 13, 2020 · 0 comments
Open

Remove `grunt-githooks` and use `precommit` script in `package.json` #3155

ProLoser opened this issue Jan 13, 2020 · 0 comments

Comments

@ProLoser
Copy link

@ProLoser ProLoser commented Jan 13, 2020

I noticed this project uses grunt-githooks in order to enforce calling grunt lint as a pre-commit hook. It's unnecessary to use grunt-githooks for this purpose.

This code will accomplish the same task and would allow this project to reduce superfluous dependencies, especially considering the package was last updated 4 years ago.

// package.json
{
  // ...
  "scripts": {
    "precommit": "grunt lint",
    // ...
  }
  // ...
}

In my opinion, it would also be wise to add a new hook:

"preversion": "npm test"

After more probing, I think the way grunt-githooks is configured is either broken or confusing. Although the githook is called pre-commit it appears to be explicitly getting called in package.json anyway in prepublish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.