Skip to content

Pre-commit hook fails because it can't find lint-staged #11603

@davehowson

Description

@davehowson

Describe the bug

image
Pre-commit hook fails when I try to commit using GitHub Desktop.

Following is an excerpt of my package.json file

 "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{js,jsx,ts,tsx}": "npm run lint"
  }

This works when trying to commit using the command line and when tried using VSCode's Git integration, but fails on GitHub Desktop.
lint-stage is installed locally and I prefer to keep it that way.

Version & OS

Version 2.6.3
Windows 10 Home

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions