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

Hard to understand stashing behavior #1402

Closed
benwiley4000 opened this issue Mar 27, 2024 · 2 comments
Closed

Hard to understand stashing behavior #1402

benwiley4000 opened this issue Mar 27, 2024 · 2 comments

Comments

@benwiley4000
Copy link

Description

I'm not sure if this is a bug or just a question, but I'm trying to understand the stashing behavior of lint-staged. I have typescript running as part of my config (via function with no used arguments), and I would expect that any unstaged changes would be stashed before typescript is run, then unstashed afterward. But I am getting type errors reported from files that aren't staged. So perhaps I've misunderstood exactly what lint-staged is stashing, and why.

Steps to reproduce

Stage a file with no type errors, don't stage another file that has type errors.

module.exports = {
    "/**/*.{ts,tsx}": ["eslint --max-warnings=0", () => "tsc"],
};

Environment

Windows 11, lint-staged 15.2.1

@iiroj
Copy link
Member

iiroj commented Mar 29, 2024

Maybe it's not clear enough in the readme: only unstaged changes to partially staged files are stashed. This is because stashing everything is a lot slower, affecting especially big projects.

A file is partially staged when there are both staged and unstaged changes to it.

@iiroj iiroj closed this as not planned Won't fix, can't repro, duplicate, stale Apr 28, 2024
@benwiley4000
Copy link
Author

benwiley4000 commented Apr 28, 2024 via email

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

2 participants