fix: prevent lint-staged from crashing on Windows with large file sets#3756
fix: prevent lint-staged from crashing on Windows with large file sets#3756
Conversation
|
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
TL;DR — Switches the Key changes
Summary | 1 file | 1 commit | base: The change is a single-character diff (
Closes #3754. |
There was a problem hiding this comment.
This draft PR contains no code changes — just an empty "Initial plan" commit. Nothing to review yet. Will re-review once implementation commits are pushed.
…ocesses on Windows Agent-Logs-Url: https://github.com/hey-api/openapi-ts/sessions/03ec608d-b661-4244-b872-67f7043a87b6 Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
|
@copilot is this fix going to work cross-env? How come it wasn't an issue on other platforms before? |
Yes, the fix works cross-platform. The function form is a standard lint-staged feature supported on all OSes. The reason it wasn't an issue on Linux/macOS before: those systems have a much higher Using a function instead of a plain array tells lint-staged "don't append file paths to these commands at all". |
There was a problem hiding this comment.
Reviewed — no issues found.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3756 +/- ##
=======================================
Coverage 40.04% 40.04%
=======================================
Files 520 520
Lines 19243 19243
Branches 5726 5726
=======================================
Hits 7705 7705
Misses 9342 9342
Partials 2196 2196
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

On Windows, lint-staged appends all matched staged-file paths as CLI arguments to each configured command. With 400+ snapshot files staged, the command line exceeded Windows's maximum length limit, causing lint-staged to batch files across ~20 separate Node.js processes and ultimately crash.
Change
Use a function instead of a plain array in
lint-staged.config.js. When lint-staged receives a function, it passes the file list to the function but does not append files to the returned command strings — the commands run once on the whole directory, which is already the correct behaviour foroxfmt .andeslint . --fix.