Skip to content

Commit 2447c8b

Browse files
authored
[torchci] Bump prettier 2.6.2 -> 2.8.8 to support satisfies (fixes yarn format CI) (#8274)
## Problem The `Run yarn format` CI step (`yarn prettier --write .`) fails on **every** torchci PR — including [#8220](#8220), which doesn't touch the affected files: ``` [error] components/job/AdvisorSection.tsx: SyntaxError: ',' expected. (15:3) } satisfies Record<AdvisorVerdictType, { border: string; badge: string }>; [error] components/job/AiAdvisorIndicator.tsx: SyntaxError: ',' expected. (79:3) error Command failed with exit code 2. ``` `torchci` pins **`prettier@2.6.2`**, which predates TypeScript **`satisfies`** support (added in prettier **2.8.0**). Three files on `main` use `satisfies` (`components/job/AdvisorSection.tsx`, `components/job/AiAdvisorIndicator.tsx`, `components/autorevert/AutorevertCell.tsx`), so `prettier --write .` can't parse them and exits non-zero — failing the format step under `set -e` before the diff check. This is pre-existing `main` breakage, not caused by the PRs that hit it. ## Fix Bump `prettier` `2.6.2 → 2.8.8` (last 2.x — adds `satisfies` support with a minimal formatting delta vs a 3.x major). ## Impact - `prettier --check .` now passes ("All matched files use Prettier code style!"). - Formatting churn is just **2 pre-existing files**, 1 line each, where 2.8 parenthesizes indexed-access-on-`typeof` (`typeof X[K]` → `(typeof X)[K]`). - `yarn.lock` change is limited to the `prettier` entry (no mass re-resolution). ## Test plan - `yarn prettier --write .` → exit 0, no `satisfies` parse errors. - `yarn prettier --check .` → clean. AI assistance (Claude) was used for this change. Signed-off-by: Andrey Talman <atalman@users.noreply.github.com> Co-authored-by: Andrey Talman <atalman@users.noreply.github.com>
1 parent 2dc447a commit 2447c8b

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

torchci/components/benchmark_v3/configs/config_book_types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const BenchmarkPageType = {
2424

2525
// Infer the type automatically
2626
export type BenchmarkPageType =
27-
typeof BenchmarkPageType[keyof typeof BenchmarkPageType];
27+
(typeof BenchmarkPageType)[keyof typeof BenchmarkPageType];
2828

2929
export type BenchmarkUIConfig = {
3030
apiId: string;

torchci/components/testStats/TestStatsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type Row = {
3939
};
4040

4141
const COUNT_KEYS = ["total", "skipped", "flaky", "failure"] as const;
42-
type CountKey = typeof COUNT_KEYS[number];
42+
type CountKey = (typeof COUNT_KEYS)[number];
4343

4444
const COUNT_LABELS: Record<CountKey, string> = {
4545
total: "Total",

torchci/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"jest": "^29.7.0",
9696
"monaco-editor": "^0.33.0",
9797
"nock": "^13.2.6",
98-
"prettier": "2.6.2",
98+
"prettier": "2.8.8",
9999
"prettier-plugin-organize-imports": "^3.2.4",
100100
"ts-jest": "^29.2.5",
101101
"typescript": "^5.7.2"

torchci/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7857,10 +7857,10 @@ prettier-plugin-organize-imports@^3.2.4:
78577857
resolved "https://registry.yarnpkg.com/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-3.2.4.tgz#77967f69d335e9c8e6e5d224074609309c62845e"
78587858
integrity sha512-6m8WBhIp0dfwu0SkgfOxJqh+HpdyfqSSLfKKRZSFbDuEQXDDndb8fTpRWkUrX/uBenkex3MgnVk0J3b3Y5byog==
78597859

7860-
prettier@2.6.2:
7861-
version "2.6.2"
7862-
resolved "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz"
7863-
integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==
7860+
prettier@2.8.8:
7861+
version "2.8.8"
7862+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
7863+
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
78647864

78657865
pretty-format@^29.0.0, pretty-format@^29.7.0:
78667866
version "29.7.0"

0 commit comments

Comments
 (0)