From 9d576891121cfc2410b1a899af095a09f8b363ed Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Mon, 20 Jul 2026 09:32:27 +0100 Subject: [PATCH] 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 --- .yarn/patches/prettier-npm-3.7.4.patch | 14 ++++++++++++++ package.json | 1 + yarn.lock | 9 +++++++++ 3 files changed, 24 insertions(+) create mode 100644 .yarn/patches/prettier-npm-3.7.4.patch diff --git a/.yarn/patches/prettier-npm-3.7.4.patch b/.yarn/patches/prettier-npm-3.7.4.patch new file mode 100644 index 0000000000..d44ad51a41 --- /dev/null +++ b/.yarn/patches/prettier-npm-3.7.4.patch @@ -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, diff --git a/package.json b/package.json index 07620c6e6e..3c7fd787e3 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "request/tough-cookie": "5.1.2", "request/form-data": "2.5.6", "request/qs": "6.15.2", + "prettier@npm:3.7.4": "patch:prettier@npm%3A3.7.4#~/.yarn/patches/prettier-npm-3.7.4.patch", "@cypress/request/qs": "6.15.2", "qs": "6.15.2", "@opentelemetry/api": "1.9.0", diff --git a/yarn.lock b/yarn.lock index 23fa9e14e2..3a046249a1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27243,6 +27243,15 @@ __metadata: languageName: node linkType: hard +"prettier@patch:prettier@npm%3A3.7.4#~/.yarn/patches/prettier-npm-3.7.4.patch": + version: 3.7.4 + resolution: "prettier@patch:prettier@npm%3A3.7.4#~/.yarn/patches/prettier-npm-3.7.4.patch::version=3.7.4&hash=0ce00c" + bin: + prettier: bin/prettier.cjs + checksum: 10c0/5a83fc7bf8ec838d1d9989110412df73cf5c0c367bc54994cde2bb45a18de15cc496270b249eb6d01923495295a1978ca00712c9c5acc2586c56cf161c7b452d + languageName: node + linkType: hard + "pretty-bytes@npm:^5.6.0": version: 5.6.0 resolution: "pretty-bytes@npm:5.6.0"