From a3a8cbd5d1aa2ca960d616a134003a8b18b8b95d Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Tue, 21 Jul 2026 13:36:08 -0400 Subject: [PATCH] Bump prettier and format --- .../csharp-spector-coverage-gaps/SKILL.md | 9 +-- AGENTS.md | 1 + eng/common/scripts/labels/policy.ts | 3 +- .../src/builders/object-builder.ts | 4 +- packages/asset-emitter/src/types.ts | 8 +-- packages/compiler/src/core/checker.ts | 8 +-- packages/compiler/src/core/name-resolver.ts | 3 +- packages/compiler/src/core/scanner.ts | 4 +- packages/compiler/src/core/types.ts | 19 +----- .../compiler/src/experimental/mutators.ts | 4 +- packages/compiler/src/server/serverlib.ts | 4 +- packages/compiler/src/server/tmlanguage.ts | 8 +-- .../class-declaration/class-method.tsx | 3 +- .../pydantic-class-declaration.tsx | 3 +- .../function-declaration.tsx | 3 +- .../components/function-declaration.tsx | 3 +- .../components/interface-declaration.tsx | 3 +- .../src/react/type-config.ts | 10 +-- .../http-canonicalization/src/operation.ts | 13 ++-- packages/http-canonicalization/src/options.ts | 8 +-- .../emitter/src/lib/type-converter.ts | 3 +- .../emitter/src/type/input-type.ts | 5 +- .../test/Unit/client-initialization.test.ts | 3 +- .../e2e/http/payload/multipart/main.test.ts | 4 +- .../emitter/src/code-model.ts | 3 +- .../generated-defs/package.json.ts | 2 +- .../http-server-js/src/util/differentiate.ts | 3 +- packages/http-specs/spec-summary.md | 4 +- packages/http/src/private.decorators.ts | 16 ++--- packages/http/src/types.ts | 12 +--- .../src/cli/actions/convert/interfaces.ts | 6 +- packages/openapi3/src/types.ts | 20 +----- packages/protobuf/src/ast.ts | 9 +-- packages/protobuf/src/transform/index.ts | 31 +++------ packages/rest/src/rest.ts | 8 +-- .../src/tmlanguage-generator.ts | 4 +- .../components/decorator-signature-type.tsx | 34 +++++----- .../components/function-signature-type.tsx | 34 +++++----- .../typespec-vscode/src/typespec-utils.ts | 4 +- .../test/versioning-timeline.test.ts | 4 +- pnpm-lock.yaml | 65 ++++++++++--------- pnpm-workspace.yaml | 2 +- .../emitters/protobuf/reference/data-types.md | 30 ++++----- .../handbook/configuration/configuration.mdx | 6 +- .../libraries/rest/reference/data-types.md | 2 +- 45 files changed, 163 insertions(+), 272 deletions(-) diff --git a/.github/skills/csharp-spector-coverage-gaps/SKILL.md b/.github/skills/csharp-spector-coverage-gaps/SKILL.md index c95fb1a5a7b..2232af6b222 100644 --- a/.github/skills/csharp-spector-coverage-gaps/SKILL.md +++ b/.github/skills/csharp-spector-coverage-gaps/SKILL.md @@ -240,11 +240,12 @@ The test directory structure mirrors the spec path with these transformations: **Namespace pattern**: `TestProjects.Spector.Tests.Http.` Example mappings: -| Spec path | Test directory | Namespace | -|-----------|---------------|-----------| -| `http/encode/duration` | `Http/Encode/Duration/` | `TestProjects.Spector.Tests.Http.Encode.Duration` | + +| Spec path | Test directory | Namespace | +| ------------------------------- | --------------------------------- | ----------------------------------------------------------- | +| `http/encode/duration` | `Http/Encode/Duration/` | `TestProjects.Spector.Tests.Http.Encode.Duration` | | `http/type/union/discriminated` | `Http/_Type/Union/Discriminated/` | `TestProjects.Spector.Tests.Http._Type.Union.Discriminated` | -| `http/special-words` | `Http/SpecialWords/` | `TestProjects.Spector.Tests.Http.SpecialWords` | +| `http/special-words` | `Http/SpecialWords/` | `TestProjects.Spector.Tests.Http.SpecialWords` | ### Test file template diff --git a/AGENTS.md b/AGENTS.md index 83280ab7036..4be3eef925f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,4 +10,5 @@ Your training data may be outdated — these docs match your installed version. - [@alloy-js/core](./packages/http-server-csharp/node_modules/@alloy-js/core/docs/index.md) - [@alloy-js/cli](./packages/http-server-csharp/node_modules/@alloy-js/cli/docs/index.md) — Alloy cli for building alloy components + diff --git a/eng/common/scripts/labels/policy.ts b/eng/common/scripts/labels/policy.ts index fb04c9b6348..c6705c618d5 100644 --- a/eng/common/scripts/labels/policy.ts +++ b/eng/common/scripts/labels/policy.ts @@ -31,7 +31,8 @@ export type IsActivitySender = { export type IsAction = { isAction: { - action: // Issues + action: + // Issues | "Opened" | "Closed" | "Reopened" diff --git a/packages/asset-emitter/src/builders/object-builder.ts b/packages/asset-emitter/src/builders/object-builder.ts index 3dd6c31ffd9..33fd4f5c9be 100644 --- a/packages/asset-emitter/src/builders/object-builder.ts +++ b/packages/asset-emitter/src/builders/object-builder.ts @@ -14,9 +14,7 @@ export class ObjectBuilder { constructor( initializer: - | Record - | Placeholder> - | ObjectBuilder = {}, + Record | Placeholder> | ObjectBuilder = {}, ) { const copyProperties = (source: Record) => { for (const [key, value] of Object.entries(source)) { diff --git a/packages/asset-emitter/src/types.ts b/packages/asset-emitter/src/types.ts index 3a249178056..5f521e4d2f4 100644 --- a/packages/asset-emitter/src/types.ts +++ b/packages/asset-emitter/src/types.ts @@ -159,13 +159,7 @@ export type AssetTagFactory = { }; export type TypeSpecDeclaration = - | Model - | Interface - | Union - | Operation - | Enum - | Scalar - | IntrinsicType; + Model | Interface | Union | Operation | Enum | Scalar | IntrinsicType; export interface ContextState { lexicalContext: Record; diff --git a/packages/compiler/src/core/checker.ts b/packages/compiler/src/core/checker.ts index 5f72cefc07e..30f44f4c4c5 100644 --- a/packages/compiler/src/core/checker.ts +++ b/packages/compiler/src/core/checker.ts @@ -355,10 +355,10 @@ export interface Checker { resolveRelatedSymbols(node: IdentifierNode): Sym[] | undefined; /** @internal */ resolveCompletions(node: IdentifierNode): Map; - createType( + createType( typeDef: T, ): T & TypePrototype & { isFinished: boolean; readonly entityKind: "Type" }; - createAndFinishType( + createAndFinishType( typeDef: T, ): T & TypePrototype; finishType(typeDef: T): T; @@ -7959,7 +7959,7 @@ export function createChecker(program: Program, resolver: NameResolver): Checker // the types here aren't ideal and could probably be refactored. - function createAndFinishType( + function createAndFinishType( typeDef: T, ): T & TypePrototype & { isFinished: boolean; readonly entityKind: "Type" } { createType(typeDef); @@ -7983,7 +7983,7 @@ export function createChecker(program: Program, resolver: NameResolver): Checker /** * Given the own-properties of a type, returns a fully-initialized type. */ - function createType( + function createType( typeDef: T, ): T & TypePrototype & { isFinished: boolean; entityKind: "Type" } { stats.createdTypes++; diff --git a/packages/compiler/src/core/name-resolver.ts b/packages/compiler/src/core/name-resolver.ts index 0d56166706d..314419008c9 100644 --- a/packages/compiler/src/core/name-resolver.ts +++ b/packages/compiler/src/core/name-resolver.ts @@ -1079,8 +1079,7 @@ export function createResolver(program: Program): NameResolver { if (binding) { if (binding.flags & SymbolFlags.Using && binding.symbolSource) { const fileNode = getFirstAncestor(node, (n) => n.kind === SyntaxKind.TypeSpecScript) as - | TypeSpecScriptNode - | undefined; + TypeSpecScriptNode | undefined; if (fileNode) { usedUsingSym.get(fileNode)?.add(binding.symbolSource) ?? usedUsingSym.set(fileNode, new Set([binding.symbolSource])); diff --git a/packages/compiler/src/core/scanner.ts b/packages/compiler/src/core/scanner.ts index d940a6b4dd5..9afdc2e51ba 100644 --- a/packages/compiler/src/core/scanner.ts +++ b/packages/compiler/src/core/scanner.ts @@ -224,9 +224,7 @@ export type DocToken = | Token.EndOfFile; export type StringTemplateToken = - | Token.StringTemplateHead - | Token.StringTemplateMiddle - | Token.StringTemplateTail; + Token.StringTemplateHead | Token.StringTemplateMiddle | Token.StringTemplateTail; /** @internal */ export const TokenDisplay = getTokenDisplayTable([ diff --git a/packages/compiler/src/core/types.ts b/packages/compiler/src/core/types.ts index 96606f13daf..d42e25e8b26 100644 --- a/packages/compiler/src/core/types.ts +++ b/packages/compiler/src/core/types.ts @@ -30,15 +30,7 @@ export interface DecoratorArgument { * Marshalled value for use in Javascript. */ jsValue: - | Type - | Value - | Record - | unknown[] - | string - | number - | boolean - | Numeric - | null; + Type | Value | Record | unknown[] | string | number | boolean | Numeric | null; node?: Node; } @@ -1516,11 +1508,7 @@ export type Expression = export type ParenthesizedExpression = Expression & { readonly parenthesized: true }; export type ReferenceExpression = - | TypeReferenceNode - | MemberExpressionNode - | IdentifierNode - | VoidKeywordNode - | NeverKeywordNode; + TypeReferenceNode | MemberExpressionNode | IdentifierNode | VoidKeywordNode | NeverKeywordNode; export interface MemberExpressionNode extends BaseNode { readonly kind: SyntaxKind.MemberExpression; @@ -1555,8 +1543,7 @@ export interface OperationSignatureReferenceNode extends BaseNode { } export type OperationSignature = - | OperationSignatureDeclarationNode - | OperationSignatureReferenceNode; + OperationSignatureDeclarationNode | OperationSignatureReferenceNode; export interface OperationStatementNode extends BaseNode, DeclarationNode, TemplateDeclarationNode { readonly kind: SyntaxKind.OperationStatement; diff --git a/packages/compiler/src/experimental/mutators.ts b/packages/compiler/src/experimental/mutators.ts index d61126789f4..55d47ff1013 100644 --- a/packages/compiler/src/experimental/mutators.ts +++ b/packages/compiler/src/experimental/mutators.ts @@ -37,9 +37,7 @@ import { Realm } from "./realm.js"; * @experimental */ export type MutatorRecord = - | MutatorReplaceRecord - | MutatorMutateRecord - | MutatorFn; + MutatorReplaceRecord | MutatorMutateRecord | MutatorFn; /** * Common functionality for mutator records. diff --git a/packages/compiler/src/server/serverlib.ts b/packages/compiler/src/server/serverlib.ts index 964cca1f927..2cad580d0d5 100644 --- a/packages/compiler/src/server/serverlib.ts +++ b/packages/compiler/src/server/serverlib.ts @@ -1588,9 +1588,7 @@ export function createServer( } type SignatureHelpNode = - | DecoratorExpressionNode - | AugmentDecoratorStatementNode - | TypeReferenceNode; + DecoratorExpressionNode | AugmentDecoratorStatementNode | TypeReferenceNode; function getSignatureHelpNodeAtPosition( script: TypeSpecScriptNode, diff --git a/packages/compiler/src/server/tmlanguage.ts b/packages/compiler/src/server/tmlanguage.ts index 025f146a326..92b268fef58 100644 --- a/packages/compiler/src/server/tmlanguage.ts +++ b/packages/compiler/src/server/tmlanguage.ts @@ -93,16 +93,12 @@ const anyNumber = `(?:${hexNumber}|${binaryNumber}|${decimalNumber})`; const expression: IncludeRule = { key: "expression", - patterns: [ - /* placeholder filled later due to cycle*/ - ], + patterns: [/* placeholder filled later due to cycle*/], }; const statement: IncludeRule = { key: "statement", - patterns: [ - /*placeholder filled later due to cycle*/ - ], + patterns: [/*placeholder filled later due to cycle*/], }; const booleanLiteral: MatchRule = { diff --git a/packages/emitter-framework/src/python/components/class-declaration/class-method.tsx b/packages/emitter-framework/src/python/components/class-declaration/class-method.tsx index 233ba5a9899..421da3c6a81 100644 --- a/packages/emitter-framework/src/python/components/class-declaration/class-method.tsx +++ b/packages/emitter-framework/src/python/components/class-declaration/class-method.tsx @@ -21,8 +21,7 @@ export interface MethodPropsWithType extends Omit = - | { kind: "parent" | "nested-items" | "ref" | "value" | "skip" } - | NestedPropertyRendering; + { kind: "parent" | "nested-items" | "ref" | "value" | "skip" } | NestedPropertyRendering; export type PropertyRenderingRaw = - | "parent" - | "nested-items" - | "ref" - | "value" - | "skip" - | NestedPropertyRenderingRaw; + "parent" | "nested-items" | "ref" | "value" | "skip" | NestedPropertyRenderingRaw; export type PropertiesRenderingRaw = { [K in keyof T]: PropertyRenderingRaw }; export type PropertiesRendering = { [K in keyof T]: PropertyRendering }; diff --git a/packages/http-canonicalization/src/operation.ts b/packages/http-canonicalization/src/operation.ts index 17b9fa8242f..5c418236597 100644 --- a/packages/http-canonicalization/src/operation.ts +++ b/packages/http-canonicalization/src/operation.ts @@ -165,9 +165,7 @@ export interface CanonicalHttpOperationResponseContent { } export type CanonicalHttpPayloadBody = - | CanonicalHttpOperationBody - | CanonicalHttpOperationMultipartBody - | CanonicalHttpOperationFileBody; + CanonicalHttpOperationBody | CanonicalHttpOperationMultipartBody | CanonicalHttpOperationFileBody; export interface CanonicalHttpOperationBodyBase { /** Content types. */ @@ -204,8 +202,7 @@ export interface CanonicalHttpOperationBody } export type CanonicalHttpOperationMultipartBody = - | CanonicalHttpOperationMultipartBodyModel - | CanonicalHttpOperationMultipartBodyTuple; + CanonicalHttpOperationMultipartBodyModel | CanonicalHttpOperationMultipartBodyTuple; export interface CanonicalHttpOperationMultipartBodyCommon extends CanonicalHttpOperationBodyBase { readonly bodyKind: "multipart"; @@ -227,8 +224,7 @@ export interface CanonicalHttpOperationMultipartBodyTuple extends CanonicalHttpO } export type CanonicalHttpOperationMultipartPartBody = - | CanonicalHttpOperationBody - | CanonicalHttpOperationFileBody; + CanonicalHttpOperationBody | CanonicalHttpOperationFileBody; export interface CanonicalHttpOperationPartCommon { /** Part body */ @@ -246,8 +242,7 @@ export interface CanonicalHttpOperationPartCommon { } export type CanonicalHttpOperationPart = - | CanonicalHttpOperationModelPart - | CanonicalHttpOperationTuplePart; + CanonicalHttpOperationModelPart | CanonicalHttpOperationTuplePart; export interface CanonicalHttpOperationModelPart extends CanonicalHttpOperationPartCommon { readonly partKind: "model"; diff --git a/packages/http-canonicalization/src/options.ts b/packages/http-canonicalization/src/options.ts index 6a66ff55cf6..dfea52b19c0 100644 --- a/packages/http-canonicalization/src/options.ts +++ b/packages/http-canonicalization/src/options.ts @@ -3,13 +3,7 @@ import { MutationOptions } from "@typespec/mutator-framework"; import type { HttpCanonicalization } from "./http-canonicalization-classes.js"; export type HttpCanonicalizationLocation = - | "header" - | "header-explode" - | "query" - | "query-explode" - | "path" - | "path-explode" - | "body"; + "header" | "header-explode" | "query" | "query-explode" | "path" | "path-explode" | "body"; export interface HttpCanonicalizationOptionsInit { visibility?: Visibility; diff --git a/packages/http-client-csharp/emitter/src/lib/type-converter.ts b/packages/http-client-csharp/emitter/src/lib/type-converter.ts index 8011d035cc4..f9557af26c2 100644 --- a/packages/http-client-csharp/emitter/src/lib/type-converter.ts +++ b/packages/http-client-csharp/emitter/src/lib/type-converter.ts @@ -266,8 +266,7 @@ function fromSdkModelProperty( const diagnostics = createDiagnosticCollector(); // TODO -- this returns undefined because some properties we do not support yet. let property = sdkContext.__typeCache.properties.get(sdkProperty) as - | InputModelProperty - | undefined; + InputModelProperty | undefined; if (property) { return diagnostics.wrap(property); } diff --git a/packages/http-client-csharp/emitter/src/type/input-type.ts b/packages/http-client-csharp/emitter/src/type/input-type.ts index ac02a59094f..5e32bd2a9b1 100644 --- a/packages/http-client-csharp/emitter/src/type/input-type.ts +++ b/packages/http-client-csharp/emitter/src/type/input-type.ts @@ -202,10 +202,7 @@ export interface InputModelProperty extends InputPropertyTypeBase { export type InputProperty = InputModelProperty | InputParameter; export type InputHttpParameter = - | InputQueryParameter - | InputPathParameter - | InputHeaderParameter - | InputBodyParameter; + InputQueryParameter | InputPathParameter | InputHeaderParameter | InputBodyParameter; export type InputParameter = InputMethodParameter | InputEndpointParameter | InputHttpParameter; diff --git a/packages/http-client-csharp/emitter/test/Unit/client-initialization.test.ts b/packages/http-client-csharp/emitter/test/Unit/client-initialization.test.ts index e03f8fcffb5..a92709bdd4d 100644 --- a/packages/http-client-csharp/emitter/test/Unit/client-initialization.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/client-initialization.test.ts @@ -157,8 +157,7 @@ describe("ClientInitialization", () => { // Find the method parameter with paramAlias const blobParam = client.parameters.find((p) => p.kind === "method" && p.name === "blob") as - | InputMethodParameter - | undefined; + InputMethodParameter | undefined; ok(blobParam, "Should have a 'blob' method parameter"); strictEqual(blobParam.paramAlias, "blobName", "paramAlias should be 'blobName'"); }); diff --git a/packages/http-client-js/test/e2e/http/payload/multipart/main.test.ts b/packages/http-client-js/test/e2e/http/payload/multipart/main.test.ts index 61260d5844b..4a427a37675 100644 --- a/packages/http-client-js/test/e2e/http/payload/multipart/main.test.ts +++ b/packages/http-client-js/test/e2e/http/payload/multipart/main.test.ts @@ -88,9 +88,7 @@ describe.skip("Payload.MultiPart", () => { const address = { city: "X" }; await client.jsonPart({ address, - profileImage: new Uint8Array([ - /* file content */ - ]), + profileImage: new Uint8Array([/* file content */]), }); }); diff --git a/packages/http-client-python/emitter/src/code-model.ts b/packages/http-client-python/emitter/src/code-model.ts index 2f00e341505..28f8d4d8489 100644 --- a/packages/http-client-python/emitter/src/code-model.ts +++ b/packages/http-client-python/emitter/src/code-model.ts @@ -299,8 +299,7 @@ function emitClient( .reduce((a, b) => [...a, ...b]) ?? []; const endpointParameter = initParameters.find((x) => x.kind === "endpoint") as - | SdkEndpointParameter - | undefined; + SdkEndpointParameter | undefined; const operationGroups = emitOperationGroups(context, client, client, "", client.apiVersions); let url: string | undefined; if (endpointParameter?.type.kind === "union") { diff --git a/packages/http-server-js/generated-defs/package.json.ts b/packages/http-server-js/generated-defs/package.json.ts index 8339ac4aa5b..9ae473ec839 100644 --- a/packages/http-server-js/generated-defs/package.json.ts +++ b/packages/http-server-js/generated-defs/package.json.ts @@ -31,6 +31,6 @@ export const hsjsDependencies: Record = { "typescript": "~6.0.2", "vitest": "^4.1.3", "yargs": "^18.0.0", - "prettier": "^3.8.1", + "prettier": "^3.9.5", "yaml": "^2.8.3", }; diff --git a/packages/http-server-js/src/util/differentiate.ts b/packages/http-server-js/src/util/differentiate.ts index 0cf18ebd514..0fdd540761d 100644 --- a/packages/http-server-js/src/util/differentiate.ts +++ b/packages/http-server-js/src/util/differentiate.ts @@ -340,8 +340,7 @@ export function differentiateUnion( }, cases: variants.map((v) => { const discriminatorPropertyType = (v.type as Model).properties.get(discriminator)!.type as - | JsLiteralType - | EnumMember; + JsLiteralType | EnumMember; return { value: { kind: "literal", value: getJsValue(ctx, discriminatorPropertyType) }, diff --git a/packages/http-specs/spec-summary.md b/packages/http-specs/spec-summary.md index abf7daaa2c7..77e08a1490f 100644 --- a/packages/http-specs/spec-summary.md +++ b/packages/http-specs/spec-summary.md @@ -101,7 +101,7 @@ Expected behavior: Should render numbered list properly. - Endpoint: `get /documentation/text-formatting/bold` -Expected behavior: Text between \*\* should render as bold. +Expected behavior: Text between ** should render as bold. ### Documentation_TextFormatting_combinedFormatting @@ -115,7 +115,7 @@ Expected behavior: Should handle nested and combined formatting. - Endpoint: `get /documentation/text-formatting/italic` Test italic text formatting using _single asterisks_. -Expected behavior: Text between \* should render as italic. +Expected behavior: Text between * should render as italic. ### Encode_Array_Property_commaDelimited diff --git a/packages/http/src/private.decorators.ts b/packages/http/src/private.decorators.ts index c045cd3235e..8eaacbefbd0 100644 --- a/packages/http/src/private.decorators.ts +++ b/packages/http/src/private.decorators.ts @@ -91,16 +91,12 @@ export const $httpFile: HttpFileDecorator = (context: DecoratorContext, target: // Validate the `ContentType` type is `TypeSpec.string`, a string literal, or a union of string literals const contentType = target.properties.get("contentType")!.type; - if ( - !( - ( - contentType.kind === "String" || // is string literal - context.program.checker.isStdType(contentType, "string") || // is TypeSpec.string - (contentType.kind === "Union" && - [...contentType.variants.values()].every((v) => v.type.kind === "String")) - ) // is union of string literals - ) - ) { + if (!( + contentType.kind === "String" || // is string literal + context.program.checker.isStdType(contentType, "string") || // is TypeSpec.string + (contentType.kind === "Union" && + [...contentType.variants.values()].every((v) => v.type.kind === "String")) // is union of string literals + )) { const contentTypeDiagnosticTarget = getTemplateArgumentTarget(templateMapper?.source, "ContentType", 0) ?? templateMetadata?.contentTypeArg; diff --git a/packages/http/src/types.ts b/packages/http/src/types.ts index 6012f1d8817..081ef2ba6b0 100644 --- a/packages/http/src/types.ts +++ b/packages/http/src/types.ts @@ -122,10 +122,7 @@ export interface Oauth2Auth extends HttpAuthBase { } export type OAuth2Flow = - | AuthorizationCodeFlow - | ImplicitFlow - | PasswordFlow - | ClientCredentialsFlow; + AuthorizationCodeFlow | ImplicitFlow | PasswordFlow | ClientCredentialsFlow; export type OAuth2FlowType = OAuth2Flow["type"]; @@ -462,9 +459,7 @@ export interface HttpOperationResponseContent { /** The possible bodies of an HTTP operation. */ export type HttpPayloadBody = - | HttpOperationBody - | HttpOperationMultipartBody - | HttpOperationFileBody; + HttpOperationBody | HttpOperationMultipartBody | HttpOperationFileBody; export interface HttpOperationBodyBase { /** Content types. */ @@ -494,8 +489,7 @@ export interface HttpOperationBody extends HttpOperationBodyBase, HttpBody { /** Body marked with `@multipartBody` */ export type HttpOperationMultipartBody = - | HttpOperationMultipartBodyModel - | HttpOperationMultipartBodyTuple; + HttpOperationMultipartBodyModel | HttpOperationMultipartBodyTuple; export interface HttpOperationMultipartBodyCommon extends HttpOperationBodyBase { readonly bodyKind: "multipart"; diff --git a/packages/openapi3/src/cli/actions/convert/interfaces.ts b/packages/openapi3/src/cli/actions/convert/interfaces.ts index c060989089a..81dffda083e 100644 --- a/packages/openapi3/src/cli/actions/convert/interfaces.ts +++ b/packages/openapi3/src/cli/actions/convert/interfaces.ts @@ -92,11 +92,7 @@ export interface TypeSpecAugmentation extends TypeSpecDecorator { } export type TypeSpecDataTypes = - | TypeSpecAlias - | TypeSpecEnum - | TypeSpecModel - | TypeSpecScalar - | TypeSpecUnion; + TypeSpecAlias | TypeSpecEnum | TypeSpecModel | TypeSpecScalar | TypeSpecUnion; export interface TypeSpecModel extends TypeSpecDeclaration { kind: "model"; diff --git a/packages/openapi3/src/types.ts b/packages/openapi3/src/types.ts index 4b4cc0141a5..8e713517915 100644 --- a/packages/openapi3/src/types.ts +++ b/packages/openapi3/src/types.ts @@ -51,8 +51,7 @@ export interface OpenAPI3Document extends Extensions { * a particular service definition. */ export type OpenAPI3ServiceRecord = - | OpenAPI3UnversionedServiceRecord - | OpenAPI3VersionedServiceRecord; + OpenAPI3UnversionedServiceRecord | OpenAPI3VersionedServiceRecord; export interface OpenAPI3UnversionedServiceRecord { /** The service that generated this OpenAPI document */ @@ -131,14 +130,7 @@ export interface OpenAPI3Tag extends Extensions { } export type OpenAPI3HttpMethod = - | "get" - | "put" - | "post" - | "delete" - | "options" - | "head" - | "patch" - | "trace"; + "get" | "put" | "post" | "delete" | "options" | "head" | "patch" | "trace"; export type OpenAPIHttpMethod3_2 = OpenAPI3HttpMethod | "query"; @@ -751,13 +743,7 @@ export interface Ref { export type Refable = Ref | T; export type JsonSchemaType = - | "array" - | "boolean" - | "integer" - | "null" - | "number" - | "object" - | "string"; + "array" | "boolean" | "integer" | "null" | "number" | "object" | "string"; export type JsonSchema = AdditionalVocabularies & { /** diff --git a/packages/protobuf/src/ast.ts b/packages/protobuf/src/ast.ts index c397a7d2c0e..e92d34dc9b1 100644 --- a/packages/protobuf/src/ast.ts +++ b/packages/protobuf/src/ast.ts @@ -58,9 +58,7 @@ export interface WellKnownFileOptions { * A top-level declaration. */ export type ProtoTopLevelDeclaration = - | ProtoServiceDeclaration - | ProtoMessageDeclaration - | ProtoEnumDeclaration; + ProtoServiceDeclaration | ProtoMessageDeclaration | ProtoEnumDeclaration; /** * A declaration. One of `service`, `message`, a field within a message, `one_of`, `enum`, or an `rpc` method. @@ -237,10 +235,7 @@ export interface ProtoMethodDeclaration extends ProtoDeclarationCommon { * A declaration that can fit within the body of a message declaration. */ export type ProtoMessageBodyDeclaration = - | ProtoFieldDeclaration - | ProtoMessageDeclaration - | ProtoOneOfDeclaration - | ProtoEnumDeclaration; + ProtoFieldDeclaration | ProtoMessageDeclaration | ProtoOneOfDeclaration | ProtoEnumDeclaration; /** * A `message` declaration. diff --git a/packages/protobuf/src/transform/index.ts b/packages/protobuf/src/transform/index.ts index 50522ba4d57..1d37c15b77b 100644 --- a/packages/protobuf/src/transform/index.ts +++ b/packages/protobuf/src/transform/index.ts @@ -203,8 +203,7 @@ function tspToProto(program: Program, emitterOptions: ProtobufEmitterOptions): P return { package: ( (details?.properties.get("name") as ModelProperty | undefined)?.type as - | StringLiteral - | undefined + StringLiteral | undefined )?.value, options: Object.fromEntries(packageOptions), @@ -886,26 +885,18 @@ function tspToProto(program: Program, emitterOptions: ProtobufEmitterOptions): P kind: "enum", name: e.name, allowAlias: needsAlias, - variants: [...e.members.values()].map( - (variant): ProtoEnumVariantDeclaration => ({ - kind: "variant", - name: variant.name, - value: variant.value as number, - doc: getDoc(program, variant), - }), - ), + variants: [...e.members.values()].map((variant): ProtoEnumVariantDeclaration => ({ + kind: "variant", + name: variant.name, + value: variant.value as number, + doc: getDoc(program, variant), + })), doc: getDoc(program, e), }; } type NamespaceTraversable = - | Enum - | Model - | Interface - | Union - | Operation - | Namespace - | IntrinsicType; + Enum | Model | Interface | Union | Operation | Namespace | IntrinsicType; function getPackageOfType(program: Program, t: NamespaceTraversable): Namespace | null { /* c8 ignore start */ @@ -990,8 +981,7 @@ function tspToProto(program: Program, emitterOptions: ProtobufEmitterOptions): P ? (map( k, addImportSourceForProtoIfNeeded(program, v, mapInfo[0], mapInfo[1]) as - | ProtoRef - | ProtoScalar, + ProtoRef | ProtoScalar, // Anything else is unreachable by construction. ) as T) : pt; @@ -1013,8 +1003,7 @@ function tspToProto(program: Program, emitterOptions: ProtobufEmitterOptions): P return pt; const dependencyDetails = program.stateMap(state.package).get(dependencyPackage) as - | Model - | undefined; + Model | undefined; const dependencyPackageName = ( dependencyDetails?.properties.get("name")?.type as StringLiteral | undefined diff --git a/packages/rest/src/rest.ts b/packages/rest/src/rest.ts index ee96bafda1e..3d2c3ee572e 100644 --- a/packages/rest/src/rest.ts +++ b/packages/rest/src/rest.ts @@ -391,13 +391,7 @@ export const $resource: ResourceDecorator = ( }; export type ResourceOperations = - | "read" - | "create" - | "createOrReplace" - | "createOrUpdate" - | "update" - | "delete" - | "list"; + "read" | "create" | "createOrReplace" | "createOrUpdate" | "update" | "delete" | "list"; export interface ResourceOperation { operation: string; diff --git a/packages/tmlanguage-generator/src/tmlanguage-generator.ts b/packages/tmlanguage-generator/src/tmlanguage-generator.ts index dcc2c46407f..6374168f33f 100644 --- a/packages/tmlanguage-generator/src/tmlanguage-generator.ts +++ b/packages/tmlanguage-generator/src/tmlanguage-generator.ts @@ -40,9 +40,7 @@ export type Captures = Record< >; export type Rule = - | MatchRule - | BeginEndRule - | IncludeRule; + MatchRule | BeginEndRule | IncludeRule; export interface MatchRule extends RuleScope, RuleKey { match: string; diff --git a/packages/tspd/src/gen-extern-signatures/components/decorator-signature-type.tsx b/packages/tspd/src/gen-extern-signatures/components/decorator-signature-type.tsx index 48f851e2077..dd322ed712e 100644 --- a/packages/tspd/src/gen-extern-signatures/components/decorator-signature-type.tsx +++ b/packages/tspd/src/gen-extern-signatures/components/decorator-signature-type.tsx @@ -33,24 +33,22 @@ export function DecoratorSignatureType(props: Readonly) name: decorator.target.name, type: , }, - ...decorator.parameters.map( - (param): ts.ParameterDescriptor => ({ - // https://github.com/alloy-framework/alloy/issues/144 - name: param.rest ? `...${param.name}` : param.name, - type: param.rest ? ( - <> - ( - {param.type ? ( - - ) : undefined} - )[] - - ) : ( - - ), - optional: param.optional, - }), - ), + ...decorator.parameters.map((param): ts.ParameterDescriptor => ({ + // https://github.com/alloy-framework/alloy/issues/144 + name: param.rest ? `...${param.name}` : param.name, + type: param.rest ? ( + <> + ( + {param.type ? ( + + ) : undefined} + )[] + + ) : ( + + ), + optional: param.optional, + })), ]; return ( ) { name: "context", type: typespecCompiler.FunctionContext, }, - ...func.parameters.map( - (param): ts.ParameterDescriptor => ({ - // https://github.com/alloy-framework/alloy/issues/144 - name: param.rest ? `...${param.name}` : param.name, - type: param.rest ? ( - <> - ( - {param.type ? ( - - ) : undefined} - )[] - - ) : ( - - ), - optional: param.optional, - }), - ), + ...func.parameters.map((param): ts.ParameterDescriptor => ({ + // https://github.com/alloy-framework/alloy/issues/144 + name: param.rest ? `...${param.name}` : param.name, + type: param.rest ? ( + <> + ( + {param.type ? ( + + ) : undefined} + )[] + + ) : ( + + ), + optional: param.optional, + })), ]; const returnType = ; diff --git a/packages/typespec-vscode/src/typespec-utils.ts b/packages/typespec-vscode/src/typespec-utils.ts index a54a69aee23..51c6d88daf7 100644 --- a/packages/typespec-vscode/src/typespec-utils.ts +++ b/packages/typespec-vscode/src/typespec-utils.ts @@ -84,8 +84,8 @@ export async function installCompilerWithUi( const locString = onlyGlobalInPaths ? "globally" : ""; let confirmOption: - | ConfirmOptions - | undefined = undefined; + ConfirmOptions | undefined = + undefined; // confirm with end user by default if (confirmOptions.confirmNeeded !== false) { const detailLink = "https://typespec.io/docs/"; diff --git a/packages/versioning/test/versioning-timeline.test.ts b/packages/versioning/test/versioning-timeline.test.ts index 96c86d355b0..44fcae45910 100644 --- a/packages/versioning/test/versioning-timeline.test.ts +++ b/packages/versioning/test/versioning-timeline.test.ts @@ -34,8 +34,8 @@ async function resolveTimelineMatrix( const { program } = await Tester.compile(content); const serviceNamespace = program.getGlobalNamespaceType().namespaces.get("TestServiceNs")!; - const libNamespaces: Namespace[] = libNamespaceNames.map( - (x) => program.getGlobalNamespaceType().namespaces.get(x)!, + const libNamespaces: Namespace[] = libNamespaceNames.map((x) => + program.getGlobalNamespaceType().namespaces.get(x)!, ); const resolutions = resolveVersions(program, serviceNamespace); const timeline = new VersioningTimeline( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3ee96b5fb04..cb6de3a2a95 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -358,8 +358,8 @@ catalogs: specifier: 1.0.0-alpha.6 version: 1.0.0-alpha.6 prettier: - specifier: ^3.8.1 - version: 3.8.4 + specifier: ^3.9.5 + version: 3.9.5 prettier-plugin-astro: specifier: ^0.14.1 version: 0.14.1 @@ -563,16 +563,16 @@ importers: version: 1.61.0 prettier: specifier: 'catalog:' - version: 3.8.4 + version: 3.9.5 prettier-plugin-astro: specifier: 'catalog:' version: 0.14.1 prettier-plugin-organize-imports: specifier: 'catalog:' - version: 4.3.0(prettier@3.8.4)(typescript@6.0.3) + version: 4.3.0(prettier@3.9.5)(typescript@6.0.3) prettier-plugin-sh: specifier: 'catalog:' - version: 0.18.1(prettier@3.8.4) + version: 0.18.1(prettier@3.9.5) rimraf: specifier: 'catalog:' version: 6.1.3 @@ -622,7 +622,7 @@ importers: dependencies: '@astrojs/check': specifier: 'catalog:' - version: 0.9.9(prettier-plugin-astro@0.14.1)(prettier@3.8.4)(typescript@6.0.3) + version: 0.9.9(prettier-plugin-astro@0.14.1)(prettier@3.9.5)(typescript@6.0.3) '@astrojs/starlight': specifier: 'catalog:' version: 0.40.0(astro@7.0.0(@astrojs/markdown-remark@7.2.0)(@azure/identity@4.13.1)(@azure/storage-blob@12.32.0)(@emnapi/core@1.11.0)(@emnapi/runtime@1.11.1)(@types/node@26.0.0)(rollup@4.62.2)(tsx@4.22.4)(yaml@2.9.0))(typescript@6.0.3) @@ -790,7 +790,7 @@ importers: version: 1.1.1 prettier: specifier: 'catalog:' - version: 3.8.4 + version: 3.9.5 semver: specifier: 'catalog:' version: 7.8.5 @@ -894,7 +894,7 @@ importers: version: 2.0.3 prettier: specifier: 'catalog:' - version: 3.8.4 + version: 3.9.5 tree-sitter-c-sharp: specifier: 'catalog:' version: 0.23.5 @@ -1137,7 +1137,7 @@ importers: version: 10.0.3 prettier: specifier: 'catalog:' - version: 3.8.4 + version: 3.9.5 packages/http-client: devDependencies: @@ -1200,7 +1200,7 @@ importers: version: link:../rest prettier: specifier: 'catalog:' - version: 3.8.4 + version: 3.9.5 devDependencies: '@alloy-js/cli': specifier: 'catalog:' @@ -1379,7 +1379,7 @@ importers: dependencies: prettier: specifier: 'catalog:' - version: 3.8.4 + version: 3.9.5 yaml: specifier: 'catalog:' version: 2.9.0 @@ -1684,7 +1684,7 @@ importers: version: 10.0.3 prettier: specifier: 'catalog:' - version: 3.8.4 + version: 3.9.5 packages/openapi: devDependencies: @@ -2099,7 +2099,7 @@ importers: dependencies: prettier: specifier: 'catalog:' - version: 3.8.4 + version: 3.9.5 devDependencies: '@typespec/compiler': specifier: workspace:^ @@ -2721,7 +2721,7 @@ importers: version: 1.1.1 prettier: specifier: 'catalog:' - version: 3.8.4 + version: 3.9.5 typedoc: specifier: 'catalog:' version: 0.28.19(typescript@6.0.3) @@ -2917,7 +2917,7 @@ importers: dependencies: '@astrojs/check': specifier: 'catalog:' - version: 0.9.9(prettier-plugin-astro@0.14.1)(prettier@3.8.4)(typescript@6.0.3) + version: 0.9.9(prettier-plugin-astro@0.14.1)(prettier@3.9.5)(typescript@6.0.3) '@astrojs/react': specifier: 'catalog:' version: 6.0.0(@types/node@26.0.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(esbuild@0.28.1)(react-dom@19.2.7(react@19.2.7))(react@19.2.7)(tsx@4.22.4)(yaml@2.9.0) @@ -11729,6 +11729,11 @@ packages: engines: {node: '>=14'} hasBin: true + prettier@3.9.5: + resolution: {integrity: sha512-/FVl766LpUfB5vXgCYOYa0MeV/441Ia99AeICQIQFTY/Nw0roZwULcXpku5i1/m5kt/baz+s4Zogspd839HSMg==} + engines: {node: '>=14'} + hasBin: true + pretty-bytes@5.6.0: resolution: {integrity: sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==} engines: {node: '>=6'} @@ -14047,9 +14052,9 @@ snapshots: '@csstools/css-tokenizer': 3.0.4 lru-cache: 10.4.3 - '@astrojs/check@0.9.9(prettier-plugin-astro@0.14.1)(prettier@3.8.4)(typescript@6.0.3)': + '@astrojs/check@0.9.9(prettier-plugin-astro@0.14.1)(prettier@3.9.5)(typescript@6.0.3)': dependencies: - '@astrojs/language-server': 2.16.10(prettier-plugin-astro@0.14.1)(prettier@3.8.4)(typescript@6.0.3) + '@astrojs/language-server': 2.16.10(prettier-plugin-astro@0.14.1)(prettier@3.9.5)(typescript@6.0.3) chokidar: 4.0.3 kleur: 4.1.5 typescript: 6.0.3 @@ -14125,7 +14130,7 @@ snapshots: smol-toml: 1.7.0 unified: 11.0.5 - '@astrojs/language-server@2.16.10(prettier-plugin-astro@0.14.1)(prettier@3.8.4)(typescript@6.0.3)': + '@astrojs/language-server@2.16.10(prettier-plugin-astro@0.14.1)(prettier@3.9.5)(typescript@6.0.3)': dependencies: '@astrojs/compiler': 2.13.1 '@astrojs/yaml2ts': 0.2.4 @@ -14139,14 +14144,14 @@ snapshots: volar-service-css: 0.0.70(@volar/language-service@2.4.28) volar-service-emmet: 0.0.70(@volar/language-service@2.4.28) volar-service-html: 0.0.70(@volar/language-service@2.4.28) - volar-service-prettier: 0.0.70(@volar/language-service@2.4.28)(prettier@3.8.4) + volar-service-prettier: 0.0.70(@volar/language-service@2.4.28)(prettier@3.9.5) volar-service-typescript: 0.0.70(@volar/language-service@2.4.28) volar-service-typescript-twoslash-queries: 0.0.70(@volar/language-service@2.4.28) volar-service-yaml: 0.0.70(@volar/language-service@2.4.28) vscode-html-languageservice: 5.6.2 vscode-uri: 3.1.0 optionalDependencies: - prettier: 3.8.4 + prettier: 3.9.5 prettier-plugin-astro: 0.14.1 transitivePeerDependencies: - typescript @@ -20114,7 +20119,7 @@ snapshots: algoliasearch: 4.27.0 clipanion: 4.0.0-rc.4(typanion@3.14.0) diff: 5.2.2 - ink: 3.2.0(@types/react@19.2.17)(react@17.0.2) + ink: 3.2.0(@types/react@19.2.17)(react@19.2.7) ink-text-input: 4.0.3(ink@3.2.0(@types/react@19.2.17)(react@17.0.2))(react@17.0.2) react: 17.0.2 semver: 7.8.5 @@ -20264,7 +20269,7 @@ snapshots: '@yarnpkg/plugin-git': 3.2.0(@yarnpkg/core@4.9.0(typanion@3.14.0))(typanion@3.14.0) clipanion: 4.0.0-rc.4(typanion@3.14.0) es-toolkit: 1.48.1 - ink: 3.2.0(@types/react@19.2.17)(react@19.2.7) + ink: 3.2.0(@types/react@19.2.17)(react@17.0.2) react: 17.0.2 semver: 7.8.5 tslib: 2.8.1 @@ -24966,22 +24971,24 @@ snapshots: prettier-plugin-astro@0.14.1: dependencies: '@astrojs/compiler': 2.13.1 - prettier: 3.8.4 + prettier: 3.9.5 sass-formatter: 0.7.9 - prettier-plugin-organize-imports@4.3.0(prettier@3.8.4)(typescript@6.0.3): + prettier-plugin-organize-imports@4.3.0(prettier@3.9.5)(typescript@6.0.3): dependencies: - prettier: 3.8.4 + prettier: 3.9.5 typescript: 6.0.3 - prettier-plugin-sh@0.18.1(prettier@3.8.4): + prettier-plugin-sh@0.18.1(prettier@3.9.5): dependencies: '@reteps/dockerfmt': 0.5.2 - prettier: 3.8.4 + prettier: 3.9.5 sh-syntax: 0.5.8 prettier@3.8.4: {} + prettier@3.9.5: {} + pretty-bytes@5.6.0: {} pretty-format@27.5.1: @@ -26903,12 +26910,12 @@ snapshots: optionalDependencies: '@volar/language-service': 2.4.28 - volar-service-prettier@0.0.70(@volar/language-service@2.4.28)(prettier@3.8.4): + volar-service-prettier@0.0.70(@volar/language-service@2.4.28)(prettier@3.9.5): dependencies: vscode-uri: 3.1.0 optionalDependencies: '@volar/language-service': 2.4.28 - prettier: 3.8.4 + prettier: 3.9.5 volar-service-typescript-twoslash-queries@0.0.70(@volar/language-service@2.4.28): dependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 0f09a8e4ecb..8da161c6167 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -124,7 +124,7 @@ catalog: playwright: ^1.60.0 plist: ^5.0.0 postject: 1.0.0-alpha.6 - prettier: ^3.8.1 + prettier: ^3.9.5 prettier-plugin-astro: ^0.14.1 prettier-plugin-organize-imports: ^4.3.0 prettier-plugin-sh: ^0.18.1 diff --git a/website/src/content/docs/docs/emitters/protobuf/reference/data-types.md b/website/src/content/docs/docs/emitters/protobuf/reference/data-types.md index 1e1149a1cd5..21b5a0fa21e 100644 --- a/website/src/content/docs/docs/emitters/protobuf/reference/data-types.md +++ b/website/src/content/docs/docs/emitters/protobuf/reference/data-types.md @@ -40,9 +40,9 @@ model Widget is Extern<"path/to/test.proto", "test.Widget">; #### Properties -| Name | Type | Description | -| -------- | ------- | ----------- | -| \_extern | `never` | | +| Name | Type | Description | +| ------- | ------- | ----------- | +| _extern | `never` | | ### `Map` {#TypeSpec.Protobuf.Map} @@ -190,9 +190,9 @@ model TypeSpec.Protobuf.WellKnown.Any #### Properties -| Name | Type | Description | -| -------- | ------- | ----------- | -| \_extern | `never` | | +| Name | Type | Description | +| ------- | ------- | ----------- | +| _extern | `never` | | ### `Empty` {#TypeSpec.Protobuf.WellKnown.Empty} @@ -206,9 +206,9 @@ model TypeSpec.Protobuf.WellKnown.Empty #### Properties -| Name | Type | Description | -| -------- | ------- | ----------- | -| \_extern | `never` | | +| Name | Type | Description | +| ------- | ------- | ----------- | +| _extern | `never` | | ### `LatLng` {#TypeSpec.Protobuf.WellKnown.LatLng} @@ -222,9 +222,9 @@ model TypeSpec.Protobuf.WellKnown.LatLng #### Properties -| Name | Type | Description | -| -------- | ------- | ----------- | -| \_extern | `never` | | +| Name | Type | Description | +| ------- | ------- | ----------- | +| _extern | `never` | | ### `Timestamp` {#TypeSpec.Protobuf.WellKnown.Timestamp} @@ -238,6 +238,6 @@ model TypeSpec.Protobuf.WellKnown.Timestamp #### Properties -| Name | Type | Description | -| -------- | ------- | ----------- | -| \_extern | `never` | | +| Name | Type | Description | +| ------- | ------- | ----------- | +| _extern | `never` | | diff --git a/website/src/content/docs/docs/handbook/configuration/configuration.mdx b/website/src/content/docs/docs/handbook/configuration/configuration.mdx index 97cfd3e0992..bc9e1a66ac9 100644 --- a/website/src/content/docs/docs/handbook/configuration/configuration.mdx +++ b/website/src/content/docs/docs/handbook/configuration/configuration.mdx @@ -150,11 +150,11 @@ options: # Extending config (child/tspconfig.yaml) extends: ../tspconfig.yaml emit: - - emitter3 # Completely replaces the emit array + - emitter3 # Completely replaces the emit array options: - emitter1: # Completely replaces emitter1 options + emitter1: # Completely replaces emitter1 options option-c: value-c - emitter3: # Added alongside emitter2 from parent + emitter3: # Added alongside emitter2 from parent option-y: value-y # Resulting merged config: diff --git a/website/src/content/docs/docs/libraries/rest/reference/data-types.md b/website/src/content/docs/docs/libraries/rest/reference/data-types.md index 5ef54891046..df25532bb14 100644 --- a/website/src/content/docs/docs/libraries/rest/reference/data-types.md +++ b/website/src/content/docs/docs/libraries/rest/reference/data-types.md @@ -160,7 +160,7 @@ model TypeSpec.Rest.Resource.ResourceDeletedResponse | Name | Type | Description | | ---- | ----- | ---------------- | -| \_ | `200` | The status code. | +| _ | `200` | The status code. | ### `ResourceError` {#TypeSpec.Rest.Resource.ResourceError}