Merge pull request #35549 from overleaf/copilot/fix-prettier-caching-issue

Work around Prettier stale-cache parse-error behavior in root format commands

GitOrigin-RevId: 1669047b3f52c15fcbff8bff41fcb1ca1257418d
This commit is contained in:
Brian Gough
2026-09-17 11:31:43 +00:00
committed by Copybot
parent d07cc5a927
commit 9d57689112
3 changed files with 24 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
diff --git a/internal/legacy-cli.mjs b/internal/legacy-cli.mjs
index a76a536..f4d95ad 100644
--- a/internal/legacy-cli.mjs
+++ b/internal/legacy-cli.mjs
@@ -5832,6 +5832,9 @@ async function formatFiles(context) {
}
output = result.formatted;
} catch (error2) {
+ // invalidate cache on format error
+ formatResultsCache?.removeFormatResultsCache(filename);
+
const errorIsIgnored = handleError(
context,
fileNameToDisplay,