Skip to content

husky/lint-staged pre-commit hook not executed #298

@ArianeBouchardConformit

Description

@ArianeBouchardConformit

Describe the bug
I have a pre-commit hook setup via lint-staged (15.5.2) and husky (9.1.7)

To Reproduce

  1. Set up lint-staged & husky
package.json
   "scripts": {
      "prepare": "husky"
   },
   "lint-staged": {
      "*.{js,vue}": "eslint --cache --max-warnings 0"
   }
.husky/pre-commit
lint-staged

And then run npm install. It should prepare everything. I think. If not, you may need to check both packages' instructions again. I struggle every update.

  1. Prepare an easy to check ESLint rule (for example, no-console)
  2. Prepare a commit violating that rule (for example, add a console.log statement to a file)
  3. Test that your hook is preventing commit in the CLI
  4. Try committing with Gitnuro. The hook is not executed; the commit goes through without a hitch

Expected behavior
Gitnuro should execute the hook & prevent my commit if it returns an error

Desktop (please complete the following information):

  • OS: Windows 11 24H2
  • Version 1.4.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghooks

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions