Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Killing the lint script still causes unstaged changes to be lost #1311

Open
brekk opened this issue Aug 7, 2023 · 3 comments
Open

Killing the lint script still causes unstaged changes to be lost #1311

brekk opened this issue Aug 7, 2023 · 3 comments

Comments

@brekk
Copy link

brekk commented Aug 7, 2023

Description

There was a previous issue: #583 which framed the experience I just had, but I'm running lint-staged@13.0.3 — I was making a commit and realized I had skipped something and muscle memory kicked in and I hit Ctrl+C while lint-staged was in the middle of running the "Cleaning up temporary files..." step.

This resulted in all my work being stashed but I didn't have a good means of introspecting where it went (and so I had to sort .git/objects by date and figure out the correct hash).

I was able to overcome this problem, but it seems like the original issue wasn't solved (?)

Steps to reproduce

I believe this happened because I hit Ctrl+C while lint-staged was in the middle of running the "Cleaning up temporary files..." step, but I am not certain.

Debug Logs

<project>/node_modules/.bin/lint-staged
✔ Preparing lint-staged...
✔ Hiding unstaged changes to partially staged files...
❯ Running tasks for staged files...
  ❯ .lintstagedrc.js — 12 files
    ❯ *.{js,jsx,ts,tsx} — 10 files
      ✖ eslint --fix [FAILED]
    ↓ package* — no files [SKIPPED]
    ↓ apps/* — no files [SKIPPED]
↓ Skipped because of errors from tasks. [SKIPPED]
↓ Skipped because of errors from tasks. [SKIPPED]
⠴ Reverting to original state because of errors...
◼ Cleaning up temporary files...
^C

Environment

  • OS: macOS Ventura 13.5
  • Node.js: v18.15.0
  • lint-staged: 13.0.3
@brekk
Copy link
Author

brekk commented Aug 7, 2023

If there isn't a good way of ameliorating this, is there some means of asking lint-staged for a log or having it print commit hashes as it works?

@Styunlen
Copy link

Also when I was about to commit a commit with 200 + files and tens of thousands of changes

@huanglong6828
Copy link

lint-staged --no-stash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants