1

For some reason, lint-staged keeps failing, showing the lint-staged due to a git error.

Using version v13.0.3.

  ✖ lint-staged failed due to a git error.
 Cleaning up temporary files...
  Any lost modifications can be restored from a git stash:

    > git stash list
    stash@{0}: automatic lint-staged backup
    > git stash apply --index stash@{0}

3 Answers3

1

Solved this issue. I checked my .git folder and found a lint-staged_unstaged.patch file. I deleted that and resolved the issue.

0

I encountered a similar problem, which turned out to be caused by file permissions. I was able to resolve the issue by by fixing the permissions.

I used the below script to change it for all files.

sudo chown -R $(whoami) <path_to_repo>

After executing this command, the issue was resolved.

0

my problem fixed by run the following command:

yarn lint (eslint --fix "src/**/*.{js,jsx,ts,tsx}" & yarn format)