diff --git a/package-lock.json b/package-lock.json index bd06c2c49e5..88196017184 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,7 @@ "eslint-plugin-security-node": "^1.1.4", "eslint-plugin-unicorn": "^54.0.0", "husky": "^9.0.7", - "prettier": "^3.3.2", + "prettier": "^3.3.3", "prettier-plugin-sh": "^0.14.0", "pretty-quick": "^4.0.0", "ts-node": "^10.9.1", @@ -15405,9 +15405,10 @@ } }, "node_modules/prettier": { - "version": "3.3.2", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, - "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, @@ -19267,7 +19268,7 @@ "devDependencies": {}, "engines": { "npm": "^10.1.0", - "vscode": "^1.68.0" + "vscode": "^1.83.0" } }, "packages/core": { @@ -19396,7 +19397,7 @@ }, "engines": { "npm": "^10.1.0", - "vscode": "^1.68.0" + "vscode": "^1.83.0" } }, "packages/core/node_modules/@types/node": { @@ -19428,7 +19429,7 @@ "devDependencies": {}, "engines": { "npm": "^10.1.0", - "vscode": "^1.68.0" + "vscode": "^1.83.0" } }, "plugins/eslint-plugin-aws-toolkits": { diff --git a/package.json b/package.json index c4b768d96e6..8d82cac692f 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "eslint-plugin-security-node": "^1.1.4", "eslint-plugin-unicorn": "^54.0.0", "husky": "^9.0.7", - "prettier": "^3.3.2", + "prettier": "^3.3.3", "prettier-plugin-sh": "^0.14.0", "pretty-quick": "^4.0.0", "ts-node": "^10.9.1", diff --git a/packages/core/src/amazonqFeatureDev/session/sessionState.ts b/packages/core/src/amazonqFeatureDev/session/sessionState.ts index 9c802811eba..05211850ded 100644 --- a/packages/core/src/amazonqFeatureDev/session/sessionState.ts +++ b/packages/core/src/amazonqFeatureDev/session/sessionState.ts @@ -77,10 +77,10 @@ function registerNewFiles( const folder = workspaceFolderPrefixes === undefined ? workspaceFolders[0] - : workspaceFolderPrefixes[prefix] ?? + : (workspaceFolderPrefixes[prefix] ?? workspaceFolderPrefixes[ Object.values(workspaceFolderPrefixes).find((val) => val.index === 0)?.name ?? '' - ] + ]) if (folder === undefined) { telemetry.toolkit_trackScenario.emit({ count: 1, diff --git a/packages/core/src/auth/connection.ts b/packages/core/src/auth/connection.ts index 29ab6d1b8ee..294fb141747 100644 --- a/packages/core/src/auth/connection.ts +++ b/packages/core/src/auth/connection.ts @@ -73,7 +73,7 @@ export function hasScopes(target: SsoConnection | SsoProfile | string[], scopes: * Not optimized, but the set of possible scopes is currently very small (< 8) */ export function hasExactScopes(target: SsoConnection | SsoProfile | string[], scopes: string[]): boolean { - const targetScopes = Array.isArray(target) ? target : target.scopes ?? [] + const targetScopes = Array.isArray(target) ? target : (target.scopes ?? []) return scopes.length === targetScopes.length && scopes.every((s) => targetScopes.includes(s)) } diff --git a/packages/core/src/awsService/iot/explorer/iotCertificateNode.ts b/packages/core/src/awsService/iot/explorer/iotCertificateNode.ts index 64d1cc3ae35..0009d057833 100644 --- a/packages/core/src/awsService/iot/explorer/iotCertificateNode.ts +++ b/packages/core/src/awsService/iot/explorer/iotCertificateNode.ts @@ -50,7 +50,7 @@ export abstract class IotCertificateNode extends AWSTreeNodeBase implements AWSR this.certificate.id, this.certificate.activeStatus, formatLocalized(this.certificate.creationDate), - things?.length ?? 0 > 0 ? `\nAttached to: ${things!.join(', ')}` : '' + (things?.length ?? 0 > 0) ? `\nAttached to: ${things!.join(', ')}` : '' ) this.iconPath = getIcon('aws-iot-certificate') this.description = `\t[${this.certificate.activeStatus}]` diff --git a/packages/core/src/awsService/iot/explorer/iotPolicyNode.ts b/packages/core/src/awsService/iot/explorer/iotPolicyNode.ts index 790a5864e6f..3f9b7003d60 100644 --- a/packages/core/src/awsService/iot/explorer/iotPolicyNode.ts +++ b/packages/core/src/awsService/iot/explorer/iotPolicyNode.ts @@ -39,7 +39,7 @@ export class IotPolicyNode extends AWSTreeNodeBase implements AWSResourceNode { 'AWS.explorerNode.iot.policyToolTip', '{0}{1}', policy.name, - certs?.length ?? 0 > 0 ? `\nAttached to: ${certs?.join(', ')}` : '' + (certs?.length ?? 0 > 0) ? `\nAttached to: ${certs?.join(', ')}` : '' ) this.iconPath = getIcon('aws-iot-policy') this.contextValue = 'awsIotPolicyNode.Certificates' diff --git a/packages/core/src/codecatalyst/devEnv.ts b/packages/core/src/codecatalyst/devEnv.ts index cd45b353358..44db151d8de 100644 --- a/packages/core/src/codecatalyst/devEnv.ts +++ b/packages/core/src/codecatalyst/devEnv.ts @@ -98,7 +98,7 @@ export class DevEnvActivityStarter { } // If user is not authenticated, assume 15 minutes. const inactivityTimeoutMin = - devenvTimeoutMs > 0 ? devenvTimeoutMs / 60000 : thisDevenv?.summary.inactivityTimeoutMinutes ?? 15 + devenvTimeoutMs > 0 ? devenvTimeoutMs / 60000 : (thisDevenv?.summary.inactivityTimeoutMinutes ?? 15) if (!shouldSendActivity(inactivityTimeoutMin)) { getLogger().info( `codecatalyst: disabling DevEnvActivity heartbeat: configured to never timeout (inactivityTimeoutMinutes=${inactivityTimeoutMin})` diff --git a/packages/core/src/codewhisperer/service/securityScanHandler.ts b/packages/core/src/codewhisperer/service/securityScanHandler.ts index d01e1050f97..86480f0766e 100644 --- a/packages/core/src/codewhisperer/service/securityScanHandler.ts +++ b/packages/core/src/codewhisperer/service/securityScanHandler.ts @@ -310,7 +310,7 @@ export async function uploadArtifactToS3( ) const errorMessage = getTelemetryReasonDesc(error)?.includes(`"PUT" request failed with code "403"`) ? `"PUT" request failed with code "403"` - : getTelemetryReasonDesc(error) ?? 'Security scan failed.' + : (getTelemetryReasonDesc(error) ?? 'Security scan failed.') throw new UploadArtifactToS3Error(errorMessage) } diff --git a/packages/core/src/lambda/models/samLambdaRuntime.ts b/packages/core/src/lambda/models/samLambdaRuntime.ts index 42a8681c672..754d910a24e 100644 --- a/packages/core/src/lambda/models/samLambdaRuntime.ts +++ b/packages/core/src/lambda/models/samLambdaRuntime.ts @@ -258,7 +258,7 @@ export function createRuntimeQuickPick(params: { totalSteps?: number }): QuickPickPrompter { const zipRuntimes = params.runtimeFamily - ? getRuntimesForFamily(params.runtimeFamily) ?? samLambdaCreatableRuntimes() + ? (getRuntimesForFamily(params.runtimeFamily) ?? samLambdaCreatableRuntimes()) : samLambdaCreatableRuntimes() const zipRuntimeItems = zipRuntimes diff --git a/packages/core/src/shared/errors.ts b/packages/core/src/shared/errors.ts index 6e4845dabee..09597a8285f 100644 --- a/packages/core/src/shared/errors.ts +++ b/packages/core/src/shared/errors.ts @@ -454,7 +454,7 @@ export function scrubNames(s: string, username?: string) { * @param err Error object, or message text */ export function getTelemetryReasonDesc(err: unknown | undefined): string | undefined { - const m = typeof err === 'string' ? err : getErrorMsg(err as Error, true) ?? '' + const m = typeof err === 'string' ? err : (getErrorMsg(err as Error, true) ?? '') const msg = scrubNames(m, _username) // Truncate message as these strings can be very long. diff --git a/packages/core/src/shared/resourcefetcher/httpResourceFetcher.ts b/packages/core/src/shared/resourcefetcher/httpResourceFetcher.ts index 68c513c4747..f2da4ba98aa 100644 --- a/packages/core/src/shared/resourcefetcher/httpResourceFetcher.ts +++ b/packages/core/src/shared/resourcefetcher/httpResourceFetcher.ts @@ -138,7 +138,7 @@ export class HttpResourceFetcher implements ResourceFetcher { } private logText(): string { - return this.params.showUrl ? this.url : this.params.friendlyName ?? 'resource from URL' + return this.params.showUrl ? this.url : (this.params.friendlyName ?? 'resource from URL') } private logCancellation(event: CancelEvent) { diff --git a/packages/core/src/shared/sam/debugger/awsSamDebugger.ts b/packages/core/src/shared/sam/debugger/awsSamDebugger.ts index babdf182b8d..49b3b186b0f 100644 --- a/packages/core/src/shared/sam/debugger/awsSamDebugger.ts +++ b/packages/core/src/shared/sam/debugger/awsSamDebugger.ts @@ -267,11 +267,11 @@ export class SamDebugConfigProvider implements vscode.DebugConfigurationProvider if (resource) { // we do not know enough to populate the runtime field for Image-based Lambdas const runtimeName = CloudFormation.isZipLambdaResource(resource?.Properties) - ? CloudFormation.getStringForProperty( + ? (CloudFormation.getStringForProperty( resource?.Properties, 'Runtime', templateDatum.item - ) ?? '' + ) ?? '') : '' configs.push( createTemplateAwsSamDebugConfig( diff --git a/packages/core/src/webviews/main.ts b/packages/core/src/webviews/main.ts index 59f45758271..379dc869fd8 100644 --- a/packages/core/src/webviews/main.ts +++ b/packages/core/src/webviews/main.ts @@ -349,7 +349,7 @@ function createWebviewPanel(ctx: vscode.ExtensionContext, params: WebviewPanelPa const viewColumn = isCloud9() && params.viewColumn === vscode.ViewColumn.Beside ? vscode.ViewColumn.Two - : params.viewColumn ?? vscode.ViewColumn.Active + : (params.viewColumn ?? vscode.ViewColumn.Active) const panel = vscode.window.createWebviewPanel( params.id,