From 1312510df71789c4d396d8f5ab6c3503ed2a7373 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 15:53:09 +0000 Subject: [PATCH] chore(deps): update dependency prettier to v3.1.0 (#2534) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Nicholas Lim <18374483+niclim@users.noreply.github.com> --- projects/fastify-capture/src/index.ts | 4 +- .../src/denormalizers/denormalizeProperty.ts | 8 +- .../src/validation/log-json-pointer.ts | 12 +- .../openapi-io/src/write/yaml-roundtrip.ts | 4 +- projects/openapi-utilities/src/diff/diff.ts | 8 +- .../src/openapi3/group-diff.ts | 12 +- .../openapi-utilities/src/openapi3/types.ts | 196 +++++++++--------- projects/openapi-utilities/src/results.ts | 8 +- .../src/utilities/changelog.ts | 16 +- projects/optic/src/client/JsonHttpClient.ts | 20 +- projects/optic/src/client/optic-backend.ts | 12 +- .../commands/capture/actions/documented.ts | 8 +- .../shapes/handlers/additionalProperties.ts | 4 +- .../patchers/shapes/handlers/newSchema.ts | 4 +- .../patches/patchers/shapes/handlers/oneOf.ts | 4 +- .../patchers/shapes/handlers/required.ts | 8 +- .../patches/patchers/shapes/handlers/type.ts | 20 +- .../capture/patches/patchers/spec/patches.ts | 4 +- .../optic/src/commands/ci/comment/common.ts | 4 +- .../changelog-renderers/json-changelog.ts | 4 +- .../changelog-renderers/terminal-changelog.ts | 44 ++-- projects/optic/src/commands/diff/compute.ts | 4 +- projects/optic/src/commands/diff/diff-all.ts | 4 +- projects/optic/src/commands/diff/diff.ts | 4 +- .../optic/src/commands/diff/upload-diff.ts | 4 +- projects/optic/src/commands/lint/lint.ts | 4 +- .../optic/src/commands/oas/diffing/patch.ts | 8 +- .../optic/src/commands/oas/lib/shell-utils.ts | 4 +- projects/optic/src/config.ts | 8 +- projects/optic/src/utils/diff-renderer.ts | 32 +-- .../src/extended-rules/spectral-rule.ts | 4 +- .../matchers/operation-matchers.ts | 16 +- .../matchers/request-body-matchers.ts | 16 +- .../matchers/response-body-matchers.ts | 16 +- .../matchers/specification-matchers.ts | 16 +- .../rulesets-base/src/rule-runner/utils.ts | 4 +- .../breaking-changes/helpers/type-change.ts | 8 +- .../src/breaking-changes/helpers/unions.ts | 24 +-- .../preventRequestExpandingWithUnionTypes.ts | 8 +- .../preventResponseNarrowingWithUnionType.ts | 8 +- .../__tests__/naming-changes.test.ts | 56 ++--- yarn.lock | 6 +- 42 files changed, 329 insertions(+), 329 deletions(-) diff --git a/projects/fastify-capture/src/index.ts b/projects/fastify-capture/src/index.ts index 08565549a4..32caedc5b4 100644 --- a/projects/fastify-capture/src/index.ts +++ b/projects/fastify-capture/src/index.ts @@ -162,8 +162,8 @@ function formatSetCookiesHeader( return typeof setCookiesHeader === 'string' ? setCookiesHeader : Array.isArray(setCookiesHeader) - ? setCookiesHeader - : String(setCookiesHeader ?? ''); + ? setCookiesHeader + : String(setCookiesHeader ?? ''); } function buildResponseCookies(setCookies: string | string[]) { diff --git a/projects/openapi-io/src/denormalizers/denormalizeProperty.ts b/projects/openapi-io/src/denormalizers/denormalizeProperty.ts index d183c72be2..3fec1878b9 100644 --- a/projects/openapi-io/src/denormalizers/denormalizeProperty.ts +++ b/projects/openapi-io/src/denormalizers/denormalizeProperty.ts @@ -81,10 +81,10 @@ export function denormalizeProperty( const polymorphicKey = schema.allOf ? 'allOf' : schema.anyOf - ? 'anyOf' - : schema.oneOf - ? 'oneOf' - : null; + ? 'anyOf' + : schema.oneOf + ? 'oneOf' + : null; const polymorphicValue = schema.allOf || schema.anyOf || schema.oneOf; if (polymorphicKey && polymorphicValue) { if ( diff --git a/projects/openapi-io/src/validation/log-json-pointer.ts b/projects/openapi-io/src/validation/log-json-pointer.ts index 2006b3043e..c8a8f96756 100644 --- a/projects/openapi-io/src/validation/log-json-pointer.ts +++ b/projects/openapi-io/src/validation/log-json-pointer.ts @@ -87,12 +87,12 @@ function renderCodeFrame( !shouldHighlight ? line : optionsOrDefault.highlightColor === 'red' - ? chalk.bold.red(lineWithObservation) - : optionsOrDefault.highlightColor === 'green' - ? chalk.bold.green(lineWithObservation) - : optionsOrDefault.highlightColor === 'yellow' - ? chalk.bold.yellow(lineWithObservation) - : line + ? chalk.bold.red(lineWithObservation) + : optionsOrDefault.highlightColor === 'green' + ? chalk.bold.green(lineWithObservation) + : optionsOrDefault.highlightColor === 'yellow' + ? chalk.bold.yellow(lineWithObservation) + : line }`; }); diff --git a/projects/openapi-io/src/write/yaml-roundtrip.ts b/projects/openapi-io/src/write/yaml-roundtrip.ts index bea6e5dec2..8c31c8fe0b 100644 --- a/projects/openapi-io/src/write/yaml-roundtrip.ts +++ b/projects/openapi-io/src/write/yaml-roundtrip.ts @@ -31,8 +31,8 @@ export function applyOperationsToYamlString( !isNaN(Number(lastIndex)) ? lastIndex : lastPathItem === '-' - ? arrayCollection.items.length - : 0, + ? arrayCollection.items.length + : 0, node ); diff --git a/projects/openapi-utilities/src/diff/diff.ts b/projects/openapi-utilities/src/diff/diff.ts index 1352802cbd..bd4a49705d 100644 --- a/projects/openapi-utilities/src/diff/diff.ts +++ b/projects/openapi-utilities/src/diff/diff.ts @@ -57,8 +57,8 @@ export function typeofDiff( return diff.after !== undefined && diff.before !== undefined ? 'changed' : diff.after !== undefined - ? 'added' - : 'removed'; + ? 'added' + : 'removed'; } // Diffs two objects, generating the leaf nodes that have changes @@ -105,8 +105,8 @@ export function diff( isPathParameterArray(afterPathIdentity) ? getParameterIdentity : allValues.every((v) => typeof v !== 'object') - ? (v: any) => String(v) - : (_, i: number) => String(i); + ? (v: any) => String(v) + : (_, i: number) => String(i); const beforeValuesById: Map = new Map( before.value.map((v, i) => [arrayIdFn(v, i), [v, i]]) diff --git a/projects/openapi-utilities/src/openapi3/group-diff.ts b/projects/openapi-utilities/src/openapi3/group-diff.ts index 00900ec938..3ee847a713 100644 --- a/projects/openapi-utilities/src/openapi3/group-diff.ts +++ b/projects/openapi-utilities/src/openapi3/group-diff.ts @@ -246,8 +246,8 @@ function normalizeRequiredDiff( fact.type === 'body' && trailParts[1] === 'required' ? jsonPointerHelpers.append(fact.location.jsonPath, 'schema') : fact.type === 'field' && trailParts[0] === 'required' - ? fact.location.jsonPath - : null; + ? fact.location.jsonPath + : null; const location = getLocation(fact); if (!maybeBaseRequiredPath) { @@ -432,10 +432,10 @@ export function groupDiffsByEndpoint( fact.type === 'request-header' ? 'headerParameters' : fact.type === 'request-query' - ? 'queryParameters' - : fact.type === 'request-cookie' - ? 'cookieParameters' - : 'pathParameters'; + ? 'queryParameters' + : fact.type === 'request-cookie' + ? 'cookieParameters' + : 'pathParameters'; const { pathPattern, method } = getLocation(fact); const endpointId = getEndpointId({ path: pathPattern, method }); const endpoint = grouped.getOrSetEndpoint(endpointId); diff --git a/projects/openapi-utilities/src/openapi3/types.ts b/projects/openapi-utilities/src/openapi3/types.ts index ad51191bee..59d03f408a 100644 --- a/projects/openapi-utilities/src/openapi3/types.ts +++ b/projects/openapi-utilities/src/openapi3/types.ts @@ -31,105 +31,105 @@ export type OpenApiV3TraverserFact = T extends T export type FactLocation = T extends 'specification' ? {} : T extends 'path' - ? { pathPattern: string } - : T extends - | 'operation' - | 'request-header' - | 'request-query' - | 'request-cookie' - | 'request-path' - | 'requestBody' - ? { pathPattern: string; method: string } - : T extends 'body' - ? - | { - location: 'response'; - pathPattern: string; - method: string; - statusCode: string; - contentType: string; - } - | { - location: 'request'; - pathPattern: string; - method: string; - contentType: string; - } - : T extends 'body-example' | 'body-examples' - ? - | { - location: 'response'; - pathPattern: string; - method: string; - statusCode: string; - contentType: string; - trail: string[]; - } - | { - location: 'request'; - pathPattern: string; - method: string; - contentType: string; - trail: string[]; - } - : T extends 'field' - ? - | { - location: 'response'; - pathPattern: string; - method: string; - statusCode: string; - contentType: string; - trail: string[]; - } - | { - location: 'request'; - pathPattern: string; - method: string; - contentType: string; - trail: string[]; - } - : T extends 'response' - ? { pathPattern: string; method: string; statusCode: string } - : T extends 'response-header' - ? { - pathPattern: string; - method: string; - statusCode: string; - headerName: string; - } - : T extends 'component-schema-example' - ? {} - : never; + ? { pathPattern: string } + : T extends + | 'operation' + | 'request-header' + | 'request-query' + | 'request-cookie' + | 'request-path' + | 'requestBody' + ? { pathPattern: string; method: string } + : T extends 'body' + ? + | { + location: 'response'; + pathPattern: string; + method: string; + statusCode: string; + contentType: string; + } + | { + location: 'request'; + pathPattern: string; + method: string; + contentType: string; + } + : T extends 'body-example' | 'body-examples' + ? + | { + location: 'response'; + pathPattern: string; + method: string; + statusCode: string; + contentType: string; + trail: string[]; + } + | { + location: 'request'; + pathPattern: string; + method: string; + contentType: string; + trail: string[]; + } + : T extends 'field' + ? + | { + location: 'response'; + pathPattern: string; + method: string; + statusCode: string; + contentType: string; + trail: string[]; + } + | { + location: 'request'; + pathPattern: string; + method: string; + contentType: string; + trail: string[]; + } + : T extends 'response' + ? { pathPattern: string; method: string; statusCode: string } + : T extends 'response-header' + ? { + pathPattern: string; + method: string; + statusCode: string; + headerName: string; + } + : T extends 'component-schema-example' + ? {} + : never; export type FactRawItem = T extends 'specification' ? OpenAPIV3.Document : T extends 'path' - ? OpenAPIV3.PathItemObject - : T extends 'operation' - ? OpenAPIV3.OperationObject - : T extends 'request-header' - ? OpenAPIV3.ParameterObject - : T extends 'request-query' - ? OpenAPIV3.ParameterObject - : T extends 'request-cookie' - ? OpenAPIV3.ParameterObject - : T extends 'request-path' - ? OpenAPIV3.ParameterObject - : T extends 'body' - ? OpenAPIV3.MediaTypeObject - : T extends 'requestBody' - ? OpenAPIV3.RequestBodyObject - : T extends 'field' - ? OpenAPIV3.SchemaObject - : T extends 'response' - ? OpenAPIV3.ResponseObject - : T extends 'response-header' - ? OpenAPIV3.HeaderObject - : T extends 'body-example' - ? NonNullable - : T extends 'body-examples' - ? OpenAPIV3.ExampleObject - : T extends 'component-schema-example' - ? OpenAPIV3.ExampleObject - : never; + ? OpenAPIV3.PathItemObject + : T extends 'operation' + ? OpenAPIV3.OperationObject + : T extends 'request-header' + ? OpenAPIV3.ParameterObject + : T extends 'request-query' + ? OpenAPIV3.ParameterObject + : T extends 'request-cookie' + ? OpenAPIV3.ParameterObject + : T extends 'request-path' + ? OpenAPIV3.ParameterObject + : T extends 'body' + ? OpenAPIV3.MediaTypeObject + : T extends 'requestBody' + ? OpenAPIV3.RequestBodyObject + : T extends 'field' + ? OpenAPIV3.SchemaObject + : T extends 'response' + ? OpenAPIV3.ResponseObject + : T extends 'response-header' + ? OpenAPIV3.HeaderObject + : T extends 'body-example' + ? NonNullable + : T extends 'body-examples' + ? OpenAPIV3.ExampleObject + : T extends 'component-schema-example' + ? OpenAPIV3.ExampleObject + : never; diff --git a/projects/openapi-utilities/src/results.ts b/projects/openapi-utilities/src/results.ts index 2652c87abb..c349d08eea 100644 --- a/projects/openapi-utilities/src/results.ts +++ b/projects/openapi-utilities/src/results.ts @@ -4,16 +4,16 @@ export function textToSev(sev: SeverityText): Severity { return sev === 'info' ? Severity.Info : sev === 'warn' - ? Severity.Warn - : Severity.Error; + ? Severity.Warn + : Severity.Error; } export function sevToText(sev: Severity): SeverityText { return sev === Severity.Info ? 'info' : sev === Severity.Warn - ? 'warn' - : 'error'; + ? 'warn' + : 'error'; } export enum Severity { diff --git a/projects/openapi-utilities/src/utilities/changelog.ts b/projects/openapi-utilities/src/utilities/changelog.ts index 6a93e8a019..be214c78cb 100644 --- a/projects/openapi-utilities/src/utilities/changelog.ts +++ b/projects/openapi-utilities/src/utilities/changelog.ts @@ -13,8 +13,8 @@ const getChangeType = (diff: ObjectDiff) => { return diff.after && diff.before ? 'changed' : diff.after - ? 'added' - : 'removed'; + ? 'added' + : 'removed'; }; const isPathChange = (segments: string[]) => segments[0] === 'paths'; @@ -223,12 +223,12 @@ export function getEndpointsChanges( return isRequestChange(segments) ? getRequestBodyChange(segments, changeType, spec) : isResponseChange(segments) - ? getResponseChange(segments, changeType, spec) - : isMethodParameterChange(segments) - ? getParameterChange(segments, changeType, spec) - : isMethodExactChange(segments) - ? `${changeType}` - : ``; + ? getResponseChange(segments, changeType, spec) + : isMethodParameterChange(segments) + ? getParameterChange(segments, changeType, spec) + : isMethodExactChange(segments) + ? `${changeType}` + : ``; }; for (const diff of diffs) { diff --git a/projects/optic/src/client/JsonHttpClient.ts b/projects/optic/src/client/JsonHttpClient.ts index 314304256c..04cda68e7f 100644 --- a/projects/optic/src/client/JsonHttpClient.ts +++ b/projects/optic/src/client/JsonHttpClient.ts @@ -37,16 +37,16 @@ export class JsonHttpClient { response.status === 400 ? new BadRequestError(message, this.source) : response.status === 401 - ? new UnauthorizedError(message, this.source) - : response.status === 403 - ? new ForbiddenError(message, this.source) - : response.status === 404 - ? new NotFoundError(message, this.source) - : response.status === 500 - ? new InternalError(message, this.source) - : response.status === 503 - ? new ServiceUnavailableError(message, this.source) - : new Error(message); + ? new UnauthorizedError(message, this.source) + : response.status === 403 + ? new ForbiddenError(message, this.source) + : response.status === 404 + ? new NotFoundError(message, this.source) + : response.status === 500 + ? new InternalError(message, this.source) + : response.status === 503 + ? new ServiceUnavailableError(message, this.source) + : new Error(message); throw error; } diff --git a/projects/optic/src/client/optic-backend.ts b/projects/optic/src/client/optic-backend.ts index 51d52fdea7..36bccbc841 100644 --- a/projects/optic/src/client/optic-backend.ts +++ b/projects/optic/src/client/optic-backend.ts @@ -30,8 +30,8 @@ export class OpticBackendClient extends JsonHttpClient { return process.env.OPTIC_ENV === 'staging' ? 'https://app.o3c.info' : process.env.OPTIC_ENV === 'local' - ? 'http://localhost:3001' - : 'https://app.useoptic.com'; + ? 'http://localhost:3001' + : 'https://app.useoptic.com'; } public getTokenOrgs(): Promise<{ @@ -288,10 +288,10 @@ export const createOpticClient = (opticToken: string) => { const backendWebBase = hostOverride ? hostOverride : process.env.OPTIC_ENV === 'staging' - ? 'https://api.o3c.info' - : process.env.OPTIC_ENV === 'local' - ? 'http://127.0.0.1:3030' - : 'https://api.useoptic.com'; + ? 'https://api.o3c.info' + : process.env.OPTIC_ENV === 'local' + ? 'http://127.0.0.1:3030' + : 'https://api.useoptic.com'; const opticClient = new OpticBackendClient(backendWebBase, () => Promise.resolve(opticToken) diff --git a/projects/optic/src/commands/capture/actions/documented.ts b/projects/optic/src/commands/capture/actions/documented.ts index 60b13031cd..768b880cf9 100644 --- a/projects/optic/src/commands/capture/actions/documented.ts +++ b/projects/optic/src/commands/capture/actions/documented.ts @@ -45,8 +45,8 @@ function locationFromPath(path: string) { parts[3] === 'requestBody' ? '[request body]' : parts[3] === 'responses' && parts[4] - ? `[${parts[4]} response body]` - : ''; + ? `[${parts[4]} response body]` + : ''; return location; } @@ -118,8 +118,8 @@ function summarizePatch( options.mode === 'update' ? `(${diff.propertyPath})` : diff.parentObjectPath - ? `(${diff.parentObjectPath})` - : ''; + ? `(${diff.parentObjectPath})` + : ''; return [color(`${location} '${diff.key}' ${action} ${propertyLocation}`)]; } else if (diff.kind === 'UnmatchedType') { // filter out dependent diffs diff --git a/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/additionalProperties.ts b/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/additionalProperties.ts index 61840dc60f..062c9e4d6f 100644 --- a/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/additionalProperties.ts +++ b/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/additionalProperties.ts @@ -130,8 +130,8 @@ export function* additionalPropertiesPatches( !shapeContext.location ? PatchImpact.BackwardsCompatibilityUnknown : 'inResponse' in shapeContext.location - ? PatchImpact.BackwardsCompatible - : PatchImpact.BackwardsIncompatible, + ? PatchImpact.BackwardsCompatible + : PatchImpact.BackwardsIncompatible, ], groupedOperations, shouldRegeneratePatches: false, diff --git a/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/newSchema.ts b/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/newSchema.ts index 8741333bc8..95e7019b11 100644 --- a/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/newSchema.ts +++ b/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/newSchema.ts @@ -20,8 +20,8 @@ export function newSchemaPatch( !shapeContext.location ? PatchImpact.BackwardsCompatibilityUnknown : 'inResponse' in shapeContext.location - ? PatchImpact.BackwardsCompatible - : PatchImpact.BackwardsIncompatible, // @acunnife, adding a new body to an existing request is backwards-incompatible, right? + ? PatchImpact.BackwardsCompatible + : PatchImpact.BackwardsIncompatible, // @acunnife, adding a new body to an existing request is backwards-incompatible, right? ], groupedOperations, shouldRegeneratePatches: false, diff --git a/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/oneOf.ts b/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/oneOf.ts index 962d022d47..8a8cb2d78f 100644 --- a/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/oneOf.ts +++ b/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/oneOf.ts @@ -83,8 +83,8 @@ export function* oneOfPatches( !shapeContext.location ? PatchImpact.BackwardsCompatibilityUnknown : 'inRequest' in shapeContext.location - ? PatchImpact.BackwardsCompatible - : PatchImpact.BackwardsIncompatible, + ? PatchImpact.BackwardsCompatible + : PatchImpact.BackwardsIncompatible, ], groupedOperations, shouldRegeneratePatches: false, diff --git a/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/required.ts b/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/required.ts index a9c61d3b99..ef4b2cf12e 100644 --- a/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/required.ts +++ b/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/required.ts @@ -92,8 +92,8 @@ export function* requiredPatches( !shapeContext.location ? PatchImpact.BackwardsCompatibilityUnknown : 'inRequest' in shapeContext.location - ? PatchImpact.BackwardsCompatible - : PatchImpact.BackwardsIncompatible, + ? PatchImpact.BackwardsCompatible + : PatchImpact.BackwardsIncompatible, ], diff, description: `make property ${diff.key} optional`, @@ -115,8 +115,8 @@ export function* requiredPatches( !shapeContext.location ? PatchImpact.BackwardsCompatibilityUnknown : 'inRequest' in shapeContext.location - ? PatchImpact.BackwardsCompatible - : PatchImpact.BackwardsIncompatible, + ? PatchImpact.BackwardsCompatible + : PatchImpact.BackwardsIncompatible, ], groupedOperations: [ ...makeOptionalOperations(requiredArray.indexOf(diff.key)), diff --git a/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/type.ts b/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/type.ts index 85b7c4735f..e5f6eda50e 100644 --- a/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/type.ts +++ b/projects/optic/src/commands/capture/patches/patchers/shapes/handlers/type.ts @@ -124,8 +124,8 @@ export function* typePatches( !shapeContext.location ? PatchImpact.BackwardsCompatibilityUnknown : 'inRequest' in shapeContext.location - ? PatchImpact.BackwardsCompatible - : PatchImpact.BackwardsIncompatible, + ? PatchImpact.BackwardsCompatible + : PatchImpact.BackwardsIncompatible, ], groupedOperations: [ { @@ -148,8 +148,8 @@ export function* typePatches( !shapeContext.location ? PatchImpact.BackwardsCompatibilityUnknown : 'inRequest' in shapeContext.location - ? PatchImpact.BackwardsCompatible - : PatchImpact.BackwardsIncompatible, + ? PatchImpact.BackwardsCompatible + : PatchImpact.BackwardsIncompatible, ], groupedOperations: makeOneOfOperations(), shouldRegeneratePatches: true, @@ -172,8 +172,8 @@ export function* typePatches( const schemaType = Array.isArray(subschema.type) ? [...subschema.type, 'null'] : subschema.type - ? [subschema.type, 'null'] - : ['null']; + ? [subschema.type, 'null'] + : ['null']; yield { description: `make ${diff.key} null`, @@ -183,8 +183,8 @@ export function* typePatches( !shapeContext.location ? PatchImpact.BackwardsCompatibilityUnknown : 'inRequest' in shapeContext.location - ? PatchImpact.BackwardsCompatible - : PatchImpact.BackwardsIncompatible, + ? PatchImpact.BackwardsCompatible + : PatchImpact.BackwardsIncompatible, ], groupedOperations: [ { @@ -206,8 +206,8 @@ export function* typePatches( !shapeContext.location ? PatchImpact.BackwardsCompatibilityUnknown : 'inRequest' in shapeContext.location - ? PatchImpact.BackwardsCompatible - : PatchImpact.BackwardsIncompatible, + ? PatchImpact.BackwardsCompatible + : PatchImpact.BackwardsIncompatible, ], groupedOperations: makeOneOfOperations(), shouldRegeneratePatches: true, diff --git a/projects/optic/src/commands/capture/patches/patchers/spec/patches.ts b/projects/optic/src/commands/capture/patches/patchers/spec/patches.ts index 91386341c1..a64dd1c17a 100644 --- a/projects/optic/src/commands/capture/patches/patchers/spec/patches.ts +++ b/projects/optic/src/commands/capture/patches/patchers/spec/patches.ts @@ -51,8 +51,8 @@ export class SpecPatch { inComponentSchema ? 'component schema' : inResponse - ? 'response body' - : 'request body' + ? 'response body' + : 'request body' }: ${shapePatch.description}`, impact: shapePatch.impact, diff: shapePatch.diff, diff --git a/projects/optic/src/commands/ci/comment/common.ts b/projects/optic/src/commands/ci/comment/common.ts index a0877b4201..0225250561 100644 --- a/projects/optic/src/commands/ci/comment/common.ts +++ b/projects/optic/src/commands/ci/comment/common.ts @@ -27,8 +27,8 @@ const getChecksLabel = ( return failingChecks > 0 ? `⚠️ **${failingChecks}**/**${totalChecks}** failed${exemptedChunk}` : totalChecks > 0 - ? `✅ **${totalChecks}** passed${exemptedChunk}` - : `ℹ️ No automated checks have run`; + ? `✅ **${totalChecks}** passed${exemptedChunk}` + : `ℹ️ No automated checks have run`; }; export const COMPARE_SUMMARY_IDENTIFIER = `optic-comment-3UsoJCz_Z0SpGLo5Vjw6o`; diff --git a/projects/optic/src/commands/diff/changelog-renderers/json-changelog.ts b/projects/optic/src/commands/diff/changelog-renderers/json-changelog.ts index e7eac1fded..daf7d826b6 100644 --- a/projects/optic/src/commands/diff/changelog-renderers/json-changelog.ts +++ b/projects/optic/src/commands/diff/changelog-renderers/json-changelog.ts @@ -528,8 +528,8 @@ function groupParameterDiffs( beforeValue.match && afterValue.match ? 'changed' : beforeValue.match - ? 'removed' - : 'added', + ? 'removed' + : 'added', before: beforeValue.match ? before : undefined, after: afterValue.match ? after : undefined, } as any); diff --git a/projects/optic/src/commands/diff/changelog-renderers/terminal-changelog.ts b/projects/optic/src/commands/diff/changelog-renderers/terminal-changelog.ts index a211fb3b42..26f4fc2f38 100644 --- a/projects/optic/src/commands/diff/changelog-renderers/terminal-changelog.ts +++ b/projects/optic/src/commands/diff/changelog-renderers/terminal-changelog.ts @@ -131,10 +131,10 @@ function getIcon(status: 'passed' | SeverityText): string { return status === 'passed' ? '✔' : status === 'info' - ? 'ⓘ' - : status === 'warn' - ? '⚠' - : 'x'; + ? 'ⓘ' + : status === 'warn' + ? '⚠' + : 'x'; } function isRuleVisible( @@ -161,12 +161,12 @@ function* getRuleLogs( const accent = result.passed ? chalk.green : result.exempted - ? chalk.gray - : result.severity === Severity.Info - ? chalk.blue - : result.severity === Severity.Warn - ? chalk.yellow - : chalk.red; + ? chalk.gray + : result.severity === Severity.Info + ? chalk.blue + : result.severity === Severity.Warn + ? chalk.yellow + : chalk.red; const icon = getIcon(result.passed ? 'passed' : sevToText(result.severity)); yield accent( `${chalk.bold(`${icon} ${`[${result.name}]` ?? ''}`)}${ @@ -271,10 +271,10 @@ export function* terminalChangelog( ? specStatus === 'passed' ? chalk.green : specStatus === 'info' - ? chalk.blue - : specStatus === 'warn' - ? chalk.yellow - : chalk.red + ? chalk.blue + : specStatus === 'warn' + ? chalk.yellow + : chalk.red : (i: string) => i; const icon = options.check ? accent(`${getIcon(specStatus)} `) : ''; yield `${icon}${chalk.bold(specName)} ${chalk.gray(options.path)}`; @@ -361,10 +361,10 @@ function* getEndpointLogs( ? endpointStatus === 'passed' ? chalk.green : endpointStatus === 'info' - ? chalk.blue - : endpointStatus === 'warn' - ? chalk.yellow - : chalk.red + ? chalk.blue + : endpointStatus === 'warn' + ? chalk.yellow + : chalk.red : (i: string) => i; yield `${accent(`${icon}${chalk.bold(method.toUpperCase())} ${path}`)}: ${ @@ -543,10 +543,10 @@ function* getBodyDetailLogs( change === 'added' ? added : change === 'removed' - ? removed - : change === 'changed' - ? changed - : '' + ? removed + : change === 'changed' + ? changed + : '' }`; if (hasRulesToRender) yield ''; yield* indent(getRuleLogs(rules, sourcemapReaders, options)); diff --git a/projects/optic/src/commands/diff/compute.ts b/projects/optic/src/commands/diff/compute.ts index 626392d708..16bf17d01b 100644 --- a/projects/optic/src/commands/diff/compute.ts +++ b/projects/optic/src/commands/diff/compute.ts @@ -54,8 +54,8 @@ export async function compute( parsed.from === 'git' ? parsed.name : parsed.from === 'file' - ? parsed.filePath - : null; + ? parsed.filePath + : null; if (filePath) { try { context = generateContext(filePath); diff --git a/projects/optic/src/commands/diff/diff-all.ts b/projects/optic/src/commands/diff/diff-all.ts index 5ced512818..4a8ed6ce7b 100644 --- a/projects/optic/src/commands/diff/diff-all.ts +++ b/projects/optic/src/commands/diff/diff-all.ts @@ -848,8 +848,8 @@ ${(spec.error as Error).message}`, options.severity === 'error' ? failures.error : options.severity === 'warn' - ? failures.warn + failures.error - : failures.warn + failures.error + failures.info; + ? failures.warn + failures.error + : failures.warn + failures.error + failures.info; return failuresForSeverity > 0; }) && diff --git a/projects/optic/src/commands/diff/diff.ts b/projects/optic/src/commands/diff/diff.ts index 481ac227d8..c85d8da878 100644 --- a/projects/optic/src/commands/diff/diff.ts +++ b/projects/optic/src/commands/diff/diff.ts @@ -529,8 +529,8 @@ const getDiffAction = options.severity === 'error' ? failures.error : options.severity === 'warn' - ? failures.warn + failures.error - : failures.warn + failures.error + failures.info; + ? failures.warn + failures.error + : failures.warn + failures.error + failures.info; if (failuresForSeverity > 0 && options.check) process.exitCode = 1; }; diff --git a/projects/optic/src/commands/diff/upload-diff.ts b/projects/optic/src/commands/diff/upload-diff.ts index bb281e2b6c..f4214f47b1 100644 --- a/projects/optic/src/commands/diff/upload-diff.ts +++ b/projects/optic/src/commands/diff/upload-diff.ts @@ -128,8 +128,8 @@ export async function uploadDiff( const reason = !specDetails ? 'no x-optic-url was set on the spec file' : config.vcs?.type === VCS.Git - ? 'there are uncommitted changes in your working directory' - : 'the current working directory is not a git repo'; + ? 'there are uncommitted changes in your working directory' + : 'the current working directory is not a git repo'; spinner?.warn(`Not uploading diff results because ${reason}`); } return null; diff --git a/projects/optic/src/commands/lint/lint.ts b/projects/optic/src/commands/lint/lint.ts index c7ae412bd6..abff846109 100644 --- a/projects/optic/src/commands/lint/lint.ts +++ b/projects/optic/src/commands/lint/lint.ts @@ -97,8 +97,8 @@ const getLintAction = options.severity === 'error' ? failures.error : options.severity === 'warn' - ? failures.warn + failures.error - : failures.warn + failures.error + failures.info; + ? failures.warn + failures.error + : failures.warn + failures.error + failures.info; if (options.web) { const analyticsData: Record = { diff --git a/projects/optic/src/commands/oas/diffing/patch.ts b/projects/optic/src/commands/oas/diffing/patch.ts index 5eddded536..2de37d1613 100644 --- a/projects/optic/src/commands/oas/diffing/patch.ts +++ b/projects/optic/src/commands/oas/diffing/patch.ts @@ -101,10 +101,10 @@ export async function renderDiffs( diff.kind === 'UnmatchedResponseStatusCode' ? `${diff.statusCode} Response ${diff.contentType}` : diff.kind === 'UnmatchedRequestBody' - ? `${diff.contentType} Request body` - : diff.kind === 'UnmatchdResponseBody' - ? `${diff.statusCode} Response ${diff.contentType}` - : ''; + ? `${diff.contentType} Request body` + : diff.kind === 'UnmatchdResponseBody' + ? `${diff.statusCode} Response ${diff.contentType}` + : ''; renderBodyDiff(specPath, description, method, pathPattern); } else if (diff.kind === 'AdditionalProperty') { diff --git a/projects/optic/src/commands/oas/lib/shell-utils.ts b/projects/optic/src/commands/oas/lib/shell-utils.ts index e5cc16fc00..971c146e3e 100644 --- a/projects/optic/src/commands/oas/lib/shell-utils.ts +++ b/projects/optic/src/commands/oas/lib/shell-utils.ts @@ -6,8 +6,8 @@ export const platform: 'mac' | 'windows' | 'linux' = process.platform === 'win32' ? 'windows' : process.platform === 'darwin' - ? 'mac' - : 'linux'; + ? 'mac' + : 'linux'; export async function exitIfNotElevated(withError: string) { const result = await isElevated(); diff --git a/projects/optic/src/config.ts b/projects/optic/src/config.ts index 05178e202c..a9b8981f5b 100644 --- a/projects/optic/src/config.ts +++ b/projects/optic/src/config.ts @@ -24,8 +24,8 @@ export const USER_CONFIG_PATH = process.env.OPTIC_ENV === 'staging' ? path.join(USER_CONFIG_DIR, 'config.staging.json') : process.env.OPTIC_ENV === 'local' - ? path.join(USER_CONFIG_DIR, 'config.local.json') - : path.join(USER_CONFIG_DIR, 'config.json'); + ? path.join(USER_CONFIG_DIR, 'config.local.json') + : path.join(USER_CONFIG_DIR, 'config.json'); const checkIsInCi = (): boolean => { const lowerCase = process.env.CI?.toLowerCase(); @@ -318,8 +318,8 @@ export async function initializeConfig(): Promise { cliConfig.authenticationType = maybeEnvToken ? 'env' : maybeUserToken - ? 'user' - : undefined; + ? 'user' + : undefined; cliConfig.isAuthenticated = true; cliConfig.userId = token.startsWith('opat') ? token.slice(4).split('.')[0] diff --git a/projects/optic/src/utils/diff-renderer.ts b/projects/optic/src/utils/diff-renderer.ts index 3e62a2a99c..133adf0576 100644 --- a/projects/optic/src/utils/diff-renderer.ts +++ b/projects/optic/src/utils/diff-renderer.ts @@ -142,27 +142,27 @@ export function* generateComparisonLogsV2( result.severity === Severity.Info ? blue : result.severity === Severity.Warn - ? yellow - : red; + ? yellow + : red; const icon = result.passed ? mdOutput ? ':heavy_check_mark:' : green('✔') : result.exempted - ? mdOutput - ? ':heavy_minus_sign:' - : white('✔') - : result.severity === Severity.Info - ? mdOutput - ? ':information_source:' - : failedAccent('ⓘ') - : result.severity === Severity.Warn - ? mdOutput - ? ':warning:' - : failedAccent('⚠') - : mdOutput - ? ':x:' - : failedAccent('x'); + ? mdOutput + ? ':heavy_minus_sign:' + : white('✔') + : result.severity === Severity.Info + ? mdOutput + ? ':information_source:' + : failedAccent('ⓘ') + : result.severity === Severity.Warn + ? mdOutput + ? ':warning:' + : failedAccent('⚠') + : mdOutput + ? ':x:' + : failedAccent('x'); const severity = failedAccent(` [${sevToText(result.severity)}]`); const rulePrefix = diff --git a/projects/rulesets-base/src/extended-rules/spectral-rule.ts b/projects/rulesets-base/src/extended-rules/spectral-rule.ts index bb2754c09a..ffca516c4d 100644 --- a/projects/rulesets-base/src/extended-rules/spectral-rule.ts +++ b/projects/rulesets-base/src/extended-rules/spectral-rule.ts @@ -82,8 +82,8 @@ function severityToOpticSeverity(spectralSev: DiagnosticSeverity): Severity { return spectralSev === DiagnosticSeverity.Error ? Severity.Error : spectralSev === DiagnosticSeverity.Warning - ? Severity.Warn - : Severity.Info; + ? Severity.Warn + : Severity.Info; } function toOpticRuleResult( diff --git a/projects/rulesets-base/src/rule-runner/matchers/operation-matchers.ts b/projects/rulesets-base/src/rule-runner/matchers/operation-matchers.ts index a1e3feb8e3..450167673e 100644 --- a/projects/rulesets-base/src/rule-runner/matchers/operation-matchers.ts +++ b/projects/rulesets-base/src/rule-runner/matchers/operation-matchers.ts @@ -28,8 +28,8 @@ export const createOperationHelpers = ( message: errorMessage ? errorMessage : strict - ? 'Expected to not find an exact match' - : 'Expected to not find a partial match', + ? 'Expected to not find an exact match' + : 'Expected to not find a partial match', received: value.raw, expected: reference, }); @@ -40,8 +40,8 @@ export const createOperationHelpers = ( message: errorMessage ? errorMessage : strict - ? 'Expected an exact match' - : 'Expected a partial match', + ? 'Expected an exact match' + : 'Expected a partial match', received: value.raw, expected: reference, }); @@ -68,8 +68,8 @@ export const createOperationHelpers = ( message: errorMessage ? errorMessage : strict - ? 'Expected to not find any exact matches' - : 'Expected to not find any partial matches', + ? 'Expected to not find any exact matches' + : 'Expected to not find any partial matches', received: value.raw, expected: references, }); @@ -83,8 +83,8 @@ export const createOperationHelpers = ( message: errorMessage ? errorMessage : strict - ? 'Expected at least one exact match' - : 'Expected at least one partial match', + ? 'Expected at least one exact match' + : 'Expected at least one partial match', received: value.raw, expected: references, }); diff --git a/projects/rulesets-base/src/rule-runner/matchers/request-body-matchers.ts b/projects/rulesets-base/src/rule-runner/matchers/request-body-matchers.ts index 420a09ffec..2ca95ca017 100644 --- a/projects/rulesets-base/src/rule-runner/matchers/request-body-matchers.ts +++ b/projects/rulesets-base/src/rule-runner/matchers/request-body-matchers.ts @@ -32,8 +32,8 @@ export const createRequestBodyHelpers = ( message: errorMessage ? errorMessage : strict - ? 'Expected to not find an exact match' - : 'Expected to not find a partial match', + ? 'Expected to not find an exact match' + : 'Expected to not find a partial match', received: value.raw, expected: reference, }); @@ -44,8 +44,8 @@ export const createRequestBodyHelpers = ( message: errorMessage ? errorMessage : strict - ? 'Expected an exact match' - : 'Expected a partial match', + ? 'Expected an exact match' + : 'Expected a partial match', received: value.raw, expected: reference, }); @@ -72,8 +72,8 @@ export const createRequestBodyHelpers = ( message: errorMessage ? errorMessage : strict - ? 'Expected to not find any exact matches' - : 'Expected to not find any partial matches', + ? 'Expected to not find any exact matches' + : 'Expected to not find any partial matches', received: value.raw, expected: references, }); @@ -87,8 +87,8 @@ export const createRequestBodyHelpers = ( message: errorMessage ? errorMessage : strict - ? 'Expected at least one exact match' - : 'Expected at least one partial match', + ? 'Expected at least one exact match' + : 'Expected at least one partial match', received: value.raw, expected: references, }); diff --git a/projects/rulesets-base/src/rule-runner/matchers/response-body-matchers.ts b/projects/rulesets-base/src/rule-runner/matchers/response-body-matchers.ts index b02005efb8..8546145063 100644 --- a/projects/rulesets-base/src/rule-runner/matchers/response-body-matchers.ts +++ b/projects/rulesets-base/src/rule-runner/matchers/response-body-matchers.ts @@ -32,8 +32,8 @@ export const createResponseBodyHelpers = ( message: errorMessage ? errorMessage : strict - ? 'Expected to not find an exact match' - : 'Expected to not find a partial match', + ? 'Expected to not find an exact match' + : 'Expected to not find a partial match', received: value.raw, expected: reference, }); @@ -44,8 +44,8 @@ export const createResponseBodyHelpers = ( message: errorMessage ? errorMessage : strict - ? 'Expected an exact match' - : 'Expected a partial match', + ? 'Expected an exact match' + : 'Expected a partial match', received: value.raw, expected: reference, }); @@ -72,8 +72,8 @@ export const createResponseBodyHelpers = ( message: errorMessage ? errorMessage : strict - ? 'Expected to not find any exact matches' - : 'Expected to not find any partial matches', + ? 'Expected to not find any exact matches' + : 'Expected to not find any partial matches', received: value.raw, expected: references, }); @@ -87,8 +87,8 @@ export const createResponseBodyHelpers = ( message: errorMessage ? errorMessage : strict - ? 'Expected at least one exact match' - : 'Expected at least one partial match', + ? 'Expected at least one exact match' + : 'Expected at least one partial match', received: value.raw, expected: references, }); diff --git a/projects/rulesets-base/src/rule-runner/matchers/specification-matchers.ts b/projects/rulesets-base/src/rule-runner/matchers/specification-matchers.ts index 7e60e9c11e..451bbb5aea 100644 --- a/projects/rulesets-base/src/rule-runner/matchers/specification-matchers.ts +++ b/projects/rulesets-base/src/rule-runner/matchers/specification-matchers.ts @@ -32,8 +32,8 @@ export const createSpecificationHelpers = ( message: errorMessage ? errorMessage : strict - ? 'Expected to not find an exact match' - : 'Expected to not find a partial match', + ? 'Expected to not find an exact match' + : 'Expected to not find a partial match', received: value.raw, expected: reference, }); @@ -44,8 +44,8 @@ export const createSpecificationHelpers = ( message: errorMessage ? errorMessage : strict - ? 'Expected an exact match' - : 'Expected a partial match', + ? 'Expected an exact match' + : 'Expected a partial match', received: value.raw, expected: reference, }); @@ -72,8 +72,8 @@ export const createSpecificationHelpers = ( message: errorMessage ? errorMessage : strict - ? 'Expected to not find any exact matches' - : 'Expected to not find any partial matches', + ? 'Expected to not find any exact matches' + : 'Expected to not find any partial matches', received: value.raw, expected: references, }); @@ -87,8 +87,8 @@ export const createSpecificationHelpers = ( message: errorMessage ? errorMessage : strict - ? 'Expected at least one exact match' - : 'Expected at least one partial match', + ? 'Expected at least one exact match' + : 'Expected at least one partial match', received: value.raw, expected: references, }); diff --git a/projects/rulesets-base/src/rule-runner/utils.ts b/projects/rulesets-base/src/rule-runner/utils.ts index 3260b0cd96..763784343c 100644 --- a/projects/rulesets-base/src/rule-runner/utils.ts +++ b/projects/rulesets-base/src/rule-runner/utils.ts @@ -8,8 +8,8 @@ const getSpecificationChange = ( return specificationNode.after?.value['x-optic-ci-empty-spec'] === true ? 'removed' : specificationNode.before?.value['x-optic-ci-empty-spec'] === true - ? 'added' - : specificationNode.change?.changeType || null; + ? 'added' + : specificationNode.change?.changeType || null; }; export const createRuleContextWithoutOperation = ( diff --git a/projects/standard-rulesets/src/breaking-changes/helpers/type-change.ts b/projects/standard-rulesets/src/breaking-changes/helpers/type-change.ts index 98326c9db7..b6abaaf5af 100644 --- a/projects/standard-rulesets/src/breaking-changes/helpers/type-change.ts +++ b/projects/standard-rulesets/src/breaking-changes/helpers/type-change.ts @@ -61,13 +61,13 @@ export function computeTypeTransition( const beforeEnum = Array.isArray(before.schema.enum) ? before.schema.enum : 'const' in before.schema - ? [before.schema.const] - : null; + ? [before.schema.const] + : null; const afterEnum = Array.isArray(after.schema.enum) ? after.schema.enum : 'const' in after.schema - ? [after.schema.const] - : null; + ? [after.schema.const] + : null; if (beforeEnum && afterEnum) { const enumResults = diffSets(new Set(beforeEnum), new Set(afterEnum)); if (enumResults.beforeSetDiff.length) diff --git a/projects/standard-rulesets/src/breaking-changes/helpers/unions.ts b/projects/standard-rulesets/src/breaking-changes/helpers/unions.ts index 852540944e..8b0fb54430 100644 --- a/projects/standard-rulesets/src/breaking-changes/helpers/unions.ts +++ b/projects/standard-rulesets/src/breaking-changes/helpers/unions.ts @@ -292,8 +292,8 @@ function diffKeyMaps( key === '' ? parentKey : parentKey === '/' - ? `${parentKey}${key}` - : `${parentKey}${SEPARATOR}${key}`; + ? `${parentKey}${key}` + : `${parentKey}${SEPARATOR}${key}`; const prefix = keyName ? `${keyName}: ` : ''; if (bValue) { if (aValue.keyword === 'type' && bValue.keyword === 'type') { @@ -413,8 +413,8 @@ function diffKeyMaps( key === '' ? parentKey : parentKey === '/' - ? `${parentKey}${key}` - : `${parentKey}${SEPARATOR}${key}`; + ? `${parentKey}${key}` + : `${parentKey}${SEPARATOR}${key}`; const prefix = keyName ? `${keyName}: ` : ''; if (!aMap.has(key) && bValue.required) { results.requestReasons.push({ @@ -450,18 +450,18 @@ export function computeUnionTransition( const beforeMaps = b.oneOf ? b.oneOf.map((s) => createKeyMapFromSchema(s)) : b.anyOf - ? b.anyOf.map((s) => createKeyMapFromSchema(s)) - : Array.isArray(b.type) - ? traverseTypeArraySchemas(b) - : [createKeyMapFromSchema(b)]; + ? b.anyOf.map((s) => createKeyMapFromSchema(s)) + : Array.isArray(b.type) + ? traverseTypeArraySchemas(b) + : [createKeyMapFromSchema(b)]; const beforeKeyword = b.oneOf ? 'oneOf' : b.anyOf ? 'anyOf' : null; const afterMaps = a.oneOf ? a.oneOf.map((s) => createKeyMapFromSchema(s)) : a.anyOf - ? a.anyOf.map((s) => createKeyMapFromSchema(s)) - : Array.isArray(a.type) - ? traverseTypeArraySchemas(a) - : [createKeyMapFromSchema(a)]; + ? a.anyOf.map((s) => createKeyMapFromSchema(s)) + : Array.isArray(a.type) + ? traverseTypeArraySchemas(a) + : [createKeyMapFromSchema(a)]; const afterKeyword = a.oneOf ? 'oneOf' : a.anyOf ? 'anyOf' : null; const { isResponse, reasons: responseReasons } = areKeymapsResponseBreaking( diff --git a/projects/standard-rulesets/src/breaking-changes/preventRequestExpandingWithUnionTypes.ts b/projects/standard-rulesets/src/breaking-changes/preventRequestExpandingWithUnionTypes.ts index d35512160c..40302c1423 100644 --- a/projects/standard-rulesets/src/breaking-changes/preventRequestExpandingWithUnionTypes.ts +++ b/projects/standard-rulesets/src/breaking-changes/preventRequestExpandingWithUnionTypes.ts @@ -20,8 +20,8 @@ export const preventRequestExpandingInUnionTypes = () => schemaIsUnion(beforeSchema) && schemaIsUnion(afterSchema) ? `request body ${keyword} schema` : schemaIsUnion(afterSchema) - ? `request body changed to ${keyword}` - : `request body changed from ${keyword}`; + ? `request body changed to ${keyword}` + : `request body changed from ${keyword}`; throw new RuleError({ message: `${prefix} did not overlap with the previous schema. ${results.requestReasons .map((r) => r.reason) @@ -46,8 +46,8 @@ export const preventRequestExpandingInUnionTypes = () => schemaIsUnion(beforeSchema) && schemaIsUnion(afterSchema) ? `request property ${keyword} schema` : schemaIsUnion(afterSchema) - ? `request property changed to ${keyword}` - : `request property changed from ${keyword}`; + ? `request property changed to ${keyword}` + : `request property changed from ${keyword}`; throw new RuleError({ message: `${prefix} did not overlap with the previous schema. ${results.requestReasons diff --git a/projects/standard-rulesets/src/breaking-changes/preventResponseNarrowingWithUnionType.ts b/projects/standard-rulesets/src/breaking-changes/preventResponseNarrowingWithUnionType.ts index 482863089c..651c3daade 100644 --- a/projects/standard-rulesets/src/breaking-changes/preventResponseNarrowingWithUnionType.ts +++ b/projects/standard-rulesets/src/breaking-changes/preventResponseNarrowingWithUnionType.ts @@ -20,8 +20,8 @@ export const preventResponseNarrowingInUnionTypes = () => schemaIsUnion(beforeSchema) && schemaIsUnion(afterSchema) ? `response body ${keyword} schema` : schemaIsUnion(afterSchema) - ? `response body changed to ${keyword}` - : `response body changed from ${keyword}`; + ? `response body changed to ${keyword}` + : `response body changed from ${keyword}`; throw new RuleError({ message: `${prefix} did not overlap with the previous schema. ${results.responseReasons .map((r) => r.reason) @@ -46,8 +46,8 @@ export const preventResponseNarrowingInUnionTypes = () => schemaIsUnion(beforeSchema) && schemaIsUnion(afterSchema) ? `response property ${keyword} schema` : schemaIsUnion(afterSchema) - ? `response property changed to ${keyword}` - : `response property changed from ${keyword}`; + ? `response property changed to ${keyword}` + : `response property changed from ${keyword}`; throw new RuleError({ message: `${prefix} did not overlap with the previous schema. ${results.responseReasons diff --git a/projects/standard-rulesets/src/naming-changes/__tests__/naming-changes.test.ts b/projects/standard-rulesets/src/naming-changes/__tests__/naming-changes.test.ts index 54c7512e0b..477d198024 100644 --- a/projects/standard-rulesets/src/naming-changes/__tests__/naming-changes.test.ts +++ b/projects/standard-rulesets/src/naming-changes/__tests__/naming-changes.test.ts @@ -104,8 +104,8 @@ describe('naming changes', () => { applies === 'always' ? after : applies === 'added' - ? TestHelpers.createEmptySpec() - : before; + ? TestHelpers.createEmptySpec() + : before; const afterJson = after; const results = await TestHelpers.runRulesWithInputs( [namingChangeRuleset], @@ -158,8 +158,8 @@ describe('naming changes', () => { applies === 'always' ? after : applies === 'added' - ? TestHelpers.createEmptySpec() - : before; + ? TestHelpers.createEmptySpec() + : before; const afterJson = after; const results = await TestHelpers.runRulesWithInputs( [namingChangeRuleset], @@ -230,8 +230,8 @@ describe('naming changes', () => { applies === 'always' ? after : applies === 'added' - ? TestHelpers.createEmptySpec() - : before; + ? TestHelpers.createEmptySpec() + : before; const afterJson = after; const results = await TestHelpers.runRulesWithInputs( [namingChangeRuleset], @@ -300,8 +300,8 @@ describe('naming changes', () => { applies === 'always' ? after : applies === 'added' - ? TestHelpers.createEmptySpec() - : before; + ? TestHelpers.createEmptySpec() + : before; const afterJson = after; const results = await TestHelpers.runRulesWithInputs( [namingChangeRuleset], @@ -376,8 +376,8 @@ describe('naming changes', () => { applies === 'always' ? after : applies === 'added' - ? TestHelpers.createEmptySpec() - : before; + ? TestHelpers.createEmptySpec() + : before; const afterJson = after; const results = await TestHelpers.runRulesWithInputs( [namingChangeRuleset], @@ -450,8 +450,8 @@ describe('naming changes', () => { applies === 'always' ? after : applies === 'added' - ? TestHelpers.createEmptySpec() - : before; + ? TestHelpers.createEmptySpec() + : before; const afterJson = after; const results = await TestHelpers.runRulesWithInputs( [namingChangeRuleset], @@ -506,8 +506,8 @@ describe('naming changes', () => { applies === 'always' ? after : applies === 'added' - ? TestHelpers.createEmptySpec() - : before; + ? TestHelpers.createEmptySpec() + : before; const afterJson = after; const results = await TestHelpers.runRulesWithInputs( [namingChangeRuleset], @@ -560,8 +560,8 @@ describe('naming changes', () => { applies === 'always' ? after : applies === 'added' - ? TestHelpers.createEmptySpec() - : before; + ? TestHelpers.createEmptySpec() + : before; const afterJson = after; const results = await TestHelpers.runRulesWithInputs( [namingChangeRuleset], @@ -630,8 +630,8 @@ describe('naming changes', () => { applies === 'always' ? after : applies === 'added' - ? TestHelpers.createEmptySpec() - : before; + ? TestHelpers.createEmptySpec() + : before; const afterJson = after; const results = await TestHelpers.runRulesWithInputs( [namingChangeRuleset], @@ -700,8 +700,8 @@ describe('naming changes', () => { applies === 'always' ? after : applies === 'added' - ? TestHelpers.createEmptySpec() - : before; + ? TestHelpers.createEmptySpec() + : before; const afterJson = after; const results = await TestHelpers.runRulesWithInputs( [namingChangeRuleset], @@ -745,8 +745,8 @@ describe('naming changes', () => { applies === 'always' ? after : applies === 'added' - ? TestHelpers.createEmptySpec() - : before; + ? TestHelpers.createEmptySpec() + : before; const afterJson = after; const results = await TestHelpers.runRulesWithInputs( [namingChangeRuleset], @@ -778,8 +778,8 @@ describe('naming changes', () => { applies === 'always' ? after : applies === 'added' - ? TestHelpers.createEmptySpec() - : before; + ? TestHelpers.createEmptySpec() + : before; const afterJson = after; const results = await TestHelpers.runRulesWithInputs( [namingChangeRuleset], @@ -823,8 +823,8 @@ describe('naming changes', () => { applies === 'always' ? after : applies === 'added' - ? TestHelpers.createEmptySpec() - : before; + ? TestHelpers.createEmptySpec() + : before; const afterJson = after; const results = await TestHelpers.runRulesWithInputs( [namingChangeRuleset], @@ -856,8 +856,8 @@ describe('naming changes', () => { applies === 'always' ? after : applies === 'added' - ? TestHelpers.createEmptySpec() - : before; + ? TestHelpers.createEmptySpec() + : before; const afterJson = after; const results = await TestHelpers.runRulesWithInputs( [namingChangeRuleset], diff --git a/yarn.lock b/yarn.lock index 6d15c96d7a..9dd4b2f40e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9832,11 +9832,11 @@ __metadata: linkType: hard "prettier@npm:^3.0.0": - version: 3.0.3 - resolution: "prettier@npm:3.0.3" + version: 3.1.0 + resolution: "prettier@npm:3.1.0" bin: prettier: bin/prettier.cjs - checksum: f950887bc03c5b970d8c6dd129364acfbbc61e7b46aec5d5ce17f4adf6404e2ef43072c98b51c4786e0eaca949b307d362a773fd47502862d754b5a328fa2b26 + checksum: a45ea70aa97fde162ea4c4aba3dfc7859aa6a732a1db34458d9535dc3c2c16d3bc3fb5689e6cd76aa835562555303b02d9449fd2e15af3b73c8053557e25c5b6 languageName: node linkType: hard