From fd2def684fb4909b177bdd9454f989fb6fa4c0d4 Mon Sep 17 00:00:00 2001 From: Cliff Hall Date: Fri, 17 Jul 2026 16:23:23 -0400 Subject: [PATCH] chore: pin prettier to 3.9.5 and run format check after install (#1716) The "Check formatting" step in main.yml ran `npx prettier --check .` before `npm install`, so npx fetched the LATEST prettier rather than the version pinned in package-lock.json. This made the format check non-deterministic and red on open PRs whenever the latest published prettier differed from the pinned one. - Pin prettier to exact 3.9.5 in devDependencies and update the lockfile - Reformat the repo with the pinned prettier (expected source churn) - Move the format check after `npm install --no-package-lock` and run it via `npm run prettier-check` so CI uses the locally-installed pinned prettier Claude-Session: https://claude.ai/code/session_01HiccCEh9mwCfVzE8qYcop1 Co-authored-by: Claude Opus 4.8 (1M context) --- .github/workflows/main.yml | 6 +++--- client/src/components/DynamicJsonForm.tsx | 6 ++---- client/src/components/ElicitationTab.tsx | 3 +-- client/src/lib/constants.ts | 5 +---- client/src/lib/hooks/useConnection.ts | 6 ++---- client/src/utils/configUtils.ts | 8 ++------ package-lock.json | 8 ++++---- package.json | 2 +- 8 files changed, 16 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6fd8a6df..c8d7405c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,9 +14,6 @@ jobs: steps: - uses: actions/checkout@v6 - - name: Check formatting - run: npx prettier --check . - - uses: actions/setup-node@v6 with: node-version-file: package.json @@ -26,6 +23,9 @@ jobs: # - run: npm ci - run: npm install --no-package-lock + - name: Check formatting + run: npm run prettier-check + - name: Check version consistency run: npm run check-version diff --git a/client/src/components/DynamicJsonForm.tsx b/client/src/components/DynamicJsonForm.tsx index 90249ab1..ba1cc73f 100644 --- a/client/src/components/DynamicJsonForm.tsx +++ b/client/src/components/DynamicJsonForm.tsx @@ -347,8 +347,7 @@ const DynamicJsonForm = forwardRef( // Titled single-select using oneOf/anyOf with const/title pairs const titledOptions = ( (propSchema.oneOf ?? propSchema.anyOf) as - | (JsonSchemaType | JsonSchemaConst)[] - | undefined + (JsonSchemaType | JsonSchemaConst)[] | undefined )?.filter((opt): opt is JsonSchemaConst => "const" in opt); if (titledOptions && titledOptions.length > 0) { @@ -606,8 +605,7 @@ const DynamicJsonForm = forwardRef( const titledMulti = ( (itemSchema.anyOf ?? itemSchema.oneOf) as - | (JsonSchemaType | JsonSchemaConst)[] - | undefined + (JsonSchemaType | JsonSchemaConst)[] | undefined )?.filter((opt): opt is JsonSchemaConst => "const" in opt); if (titledMulti && titledMulti.length > 0) { diff --git a/client/src/components/ElicitationTab.tsx b/client/src/components/ElicitationTab.tsx index 155f8448..7737aeab 100644 --- a/client/src/components/ElicitationTab.tsx +++ b/client/src/components/ElicitationTab.tsx @@ -20,8 +20,7 @@ export interface ElicitationUrlRequestData extends ElicitationRequestBase { } export type ElicitationRequestData = - | ElicitationFormRequestData - | ElicitationUrlRequestData; + ElicitationFormRequestData | ElicitationUrlRequestData; export interface ElicitationResponse { action: "accept" | "decline" | "cancel"; diff --git a/client/src/lib/constants.ts b/client/src/lib/constants.ts index d986d380..e2c73f57 100644 --- a/client/src/lib/constants.ts +++ b/client/src/lib/constants.ts @@ -30,10 +30,7 @@ export const getServerSpecificKey = ( }; export type ConnectionStatus = - | "disconnected" - | "connected" - | "error" - | "error-connecting-to-proxy"; + "disconnected" | "connected" | "error" | "error-connecting-to-proxy"; export const DEFAULT_MCP_PROXY_LISTEN_PORT = "6277"; diff --git a/client/src/lib/hooks/useConnection.ts b/client/src/lib/hooks/useConnection.ts index 9694b891..f0ec16cf 100644 --- a/client/src/lib/hooks/useConnection.ts +++ b/client/src/lib/hooks/useConnection.ts @@ -564,8 +564,7 @@ export function useConnection({ // Create appropriate transport let transportOptions: - | StreamableHTTPClientTransportOptions - | SSEClientTransportOptions; + StreamableHTTPClientTransportOptions | SSEClientTransportOptions; let serverUrl: URL; @@ -843,8 +842,7 @@ export function useConnection({ const makeTaskId = () => { // Prefer UUID when available; otherwise fall back to a reasonably unique id. const cryptoAny = globalThis.crypto as unknown as - | { randomUUID?: () => string } - | undefined; + { randomUUID?: () => string } | undefined; return ( cryptoAny?.randomUUID?.() ?? `task_${Date.now()}_${Math.random().toString(16).slice(2)}` diff --git a/client/src/utils/configUtils.ts b/client/src/utils/configUtils.ts index bc081b8f..51591ca5 100644 --- a/client/src/utils/configUtils.ts +++ b/client/src/utils/configUtils.ts @@ -59,18 +59,14 @@ export const getMCPTaskTtl = (config: InspectorConfig): number => { }; export const getInitialTransportType = (): - | "stdio" - | "sse" - | "streamable-http" => { + "stdio" | "sse" | "streamable-http" => { const param = getSearchParam("transport"); if (param === "stdio" || param === "sse" || param === "streamable-http") { return param; } return ( (localStorage.getItem("lastTransportType") as - | "stdio" - | "sse" - | "streamable-http") || "stdio" + "stdio" | "sse" | "streamable-http") || "stdio" ); }; diff --git a/package-lock.json b/package-lock.json index e917fc71..645b7683 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,7 @@ "jest-fixed-jsdom": "^0.0.9", "lint-staged": "^16.1.5", "playwright": "^1.56.1", - "prettier": "^3.7.1", + "prettier": "3.9.5", "rimraf": "^6.0.1", "typescript": "^5.4.2" }, @@ -10908,9 +10908,9 @@ } }, "node_modules/prettier": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.7.4.tgz", - "integrity": "sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==", + "version": "3.9.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.5.tgz", + "integrity": "sha512-/FVl766LpUfB5vXgCYOYa0MeV/441Ia99AeICQIQFTY/Nw0roZwULcXpku5i1/m5kt/baz+s4Zogspd839HSMg==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index 8330ebd8..ee51966c 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "jest-fixed-jsdom": "^0.0.9", "lint-staged": "^16.1.5", "playwright": "^1.56.1", - "prettier": "^3.7.1", + "prettier": "3.9.5", "rimraf": "^6.0.1", "typescript": "^5.4.2" },