Skip to content

Error thrown when running lint-staged from a child directory #1027

@jdanil

Description

@jdanil

Description

After upgrading to v11.2.1, lint-staged exits with the following error.

× Current directory is not a git directory!

I am using lint-staged in a monorepo, so each package runs the command (as advised here https://github.com/okonet/lint-staged#how-to-use-lint-staged-in-a-multi-package-monorepo), rather than being run from the repository root directory.

Steps to reproduce

  1. run lint-staged in a child directory of the git repository's root.

Debug Logs

expand to view
{
  '*': [
    'eslint --fix',
    'prettier --write'
  ]
}

Environment

  • OS: Windows 10
  • Node.js: 14.18.0
  • lint-staged: 11.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions