Skip to content

Commit 5d67093

Browse files
isaacroldanClaude Code
andcommitted
chore: resolve remaining switch-exhaustiveness-check warnings
Fix all 20 remaining eslint warnings (switch-exhaustiveness-check): - fqdn.ts: file-level suppress — all switches branch on 'local' vs default (production). Tests mock serviceEnvironment() returning undefined, so explicit enum cases break tests. - scopes.ts: add explicit 'admin'|'storefront-renderer' cases that throw - output.ts: add missing 'silent' case to logLevelValue - tree-kill.ts: suppress — default handles all Unix-like platforms - mkcert.ts: suppress — default throws for unsupported platforms - Logs.tsx: replace default with explicit BackgroundExecutionReason.Unknown - execute-bulk-operation.ts: replace default with explicit error status cases - format-bulk-operation-status.ts: replace default with explicit status cases - extension.ts: replace default with explicit undefined|liquid|config-only - declarative-definitions.ts: replace defaults with explicit GraphQL enum cases - extension-config-builder.ts: replace default with explicit undefined case, use ?? instead of || for context fallback chain Combined with the parent PR, this brings the codebase from 107 warnings to 0. Co-authored-by: Claude Code <claude-code@anthropic.com>
1 parent ccb06f4 commit 5d67093

File tree

12 files changed

+42
-42
lines changed

12 files changed

+42
-42
lines changed

nx.json

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,25 @@
11
{
22
"targetDefaults": {
33
"clean": {
4-
"dependsOn": [
5-
"^clean"
6-
]
4+
"dependsOn": ["^clean"]
75
},
86
"build": {
9-
"dependsOn": [
10-
"^build"
11-
],
12-
"inputs": [
13-
"production",
14-
"^production"
15-
]
7+
"dependsOn": ["^build"],
8+
"inputs": ["production", "^production"]
169
},
1710
"refresh-manifests": {
18-
"dependsOn": [
19-
"build",
20-
"refresh-readme"
21-
]
11+
"dependsOn": ["build", "refresh-readme"]
2212
},
2313
"refresh-readme": {
24-
"dependsOn": [
25-
"build"
26-
]
14+
"dependsOn": ["build"]
2715
},
2816
"lint": {},
2917
"lint:fix": {},
3018
"type-check": {
31-
"dependsOn": [
32-
"^build"
33-
]
19+
"dependsOn": ["^build"]
3420
},
3521
"bundle": {
36-
"dependsOn": [
37-
"build"
38-
]
22+
"dependsOn": ["build"]
3923
}
4024
},
4125
"extends": "@nx/workspace/presets/npm.json",
@@ -65,16 +49,12 @@
6549
"defaultBase": "main",
6650
"$schema": "./node_modules/nx/schemas/nx-schema.json",
6751
"namedInputs": {
68-
"default": [
69-
"{projectRoot}/**/*",
70-
"sharedGlobals"
71-
],
52+
"default": ["{projectRoot}/**/*", "sharedGlobals"],
7253
"sharedGlobals": [],
73-
"production": [
74-
"default"
75-
]
54+
"production": ["default"]
7655
},
7756
"tui": {
7857
"autoExit": true
79-
}
58+
},
59+
"analytics": false
8060
}

packages/app/src/cli/services/app-logs/logs-command/ui/components/Logs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const getBackgroundExecutionReasonMessage = (reason: BackgroundExecutionReason):
3030
return 'No cached response available'
3131
case BackgroundExecutionReason.CacheAboutToExpire:
3232
return 'Cache is about to expire'
33-
default:
33+
case BackgroundExecutionReason.Unknown:
3434
return 'Unknown reason'
3535
}
3636
}

packages/app/src/cli/services/bulk-operations/execute-bulk-operation.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ async function renderBulkOperationResult(operation: BulkOperation, outputFile?:
212212
renderSuccess({headline, customSections})
213213
}
214214
break
215-
default:
215+
case 'CANCELED':
216+
case 'CANCELING':
217+
case 'EXPIRED':
218+
case 'FAILED':
216219
renderError({headline, customSections})
217220
break
218221
}

packages/app/src/cli/services/bulk-operations/format-bulk-operation-status.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ export function formatBulkOperationCancellationResult(
9090
renderType: 'warning',
9191
}
9292
}
93-
default:
93+
case 'CREATED':
94+
case 'EXPIRED':
95+
case 'RUNNING':
9496
return {
9597
headline,
9698
renderType: 'info',

packages/app/src/cli/services/generate/extension.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ function getTemplateLanguage(flavor: ExtensionFlavorValue | undefined): Template
5757
case 'rust':
5858
case 'wasm':
5959
return flavor
60-
default:
60+
case undefined:
61+
case 'liquid':
62+
case 'config-only':
6163
return undefined
6264
}
6365
}

packages/app/src/cli/services/generate/shop-import/declarative-definitions.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,12 @@ function graphQLToAdminAccess(
710710
switch (access) {
711711
case 'MERCHANT_READ_WRITE':
712712
return 'merchant_read_write'
713-
default:
713+
case 'MERCHANT_READ':
714+
case 'PRIVATE':
715+
case 'PUBLIC_READ':
716+
case 'PUBLIC_READ_WRITE':
717+
case null:
718+
case undefined:
714719
return undefined
715720
}
716721
}
@@ -721,7 +726,9 @@ function graphQLToStorefrontAccess(
721726
switch (access) {
722727
case 'PUBLIC_READ':
723728
return 'public_read'
724-
default:
729+
case 'NONE':
730+
case null:
731+
case undefined:
725732
return undefined
726733
}
727734
}
@@ -734,7 +741,9 @@ function graphQLToCustomerAccountAccess(
734741
return 'read'
735742
case 'READ_WRITE':
736743
return 'read_write'
737-
default:
744+
case 'NONE':
745+
case null:
746+
case undefined:
738747
return undefined
739748
}
740749
}

packages/app/src/cli/services/payments/extension-config-builder.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export function buildExtensionConfig(extension: ExtensionRegistration, allExtens
9797
allExtensions,
9898
cardPresentDeployConfigToCLIConfig,
9999
)
100+
case undefined:
100101
default:
101102
throw new Error(`Unsupported extension: ${context}`)
102103
}

packages/app/src/cli/utilities/mkcert.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ async function getMkcertPath(
5858
async function downloadMkcert(targetPath: string, platform: NodeJS.Platform, arch: NodeJS.Architecture): Promise<void> {
5959
let assetName: string
6060

61+
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check -- default throws for unsupported platforms
6162
switch (platform) {
6263
case 'darwin':
6364
assetName = arch === 'arm64' ? `mkcert-${MKCERT_VERSION}-darwin-arm64` : `mkcert-${MKCERT_VERSION}-darwin-amd64`

packages/cli-kit/src/private/node/session/scopes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export function tokenExchangeScopes(api: API): string[] {
3838
return [scopeTransform('app-management')]
3939
case 'business-platform':
4040
return [scopeTransform('destinations')]
41-
default:
41+
case 'admin':
42+
case 'storefront-renderer':
4243
throw new BugError(`API not supported for token exchange: ${api}`)
4344
}
4445
}

packages/cli-kit/src/public/node/context/fqdn.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/switch-exhaustiveness-check -- all switches branch on Environment.Local vs default (production) */
12
import {AbortError} from '../error.js'
23
import {serviceEnvironment} from '../../../private/node/context/service.js'
34
import {DevServer, DevServerCore} from '../vendor/dev_server/index.js'

0 commit comments

Comments
 (0)