Skip to content

[improvement] Please add warning if pre-smth hook is located both in "scripts": {} and in "husky": {"hooks": {}} #556

@sidoruk-sv

Description

@sidoruk-sv

Got behavior, when my pre-push config was declared as:

// package.json
{
  ...,
  "scripts": {
    "prepush": "npm test"
  },
  "husky": {
    "hooks": {
      "pre-push": "npm run prepush"
    }
  }
}

After investigation understood, that this was my mistake:
Husky run both husky.hooks.pre-push AND scripts.prepush.

But it was annoying that tests were initiated twice and no warnings/errors were shown about duplicating config declaration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions