-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Open
Open
Copy link
Labels
lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)
Description
Reported here: #7948 (comment)
Should be worked on after merging #10222.
Prettier 2.2.1
Playground link
--parser typescript
Input:
export type SchemaToType<S extends Schema> = S extends SchemaLiteral
? SchemaLiteralToType<S>
: S extends SchemaPrimitive
? SchemaPrimitiveToType<S>
: S extends Schema.Record
? SchemaRecordToType<S>
: S extends Schema.Array
? SchemaArrayToType<S>
: S extends Schema.Intersection
? SchemaIntersectionToType<S>
: S extends Schema.Union
? SchemaUnionToType<S>
: S;
Output:
export type SchemaToType<S extends Schema> = S extends SchemaLiteral
? SchemaLiteralToType<S>
: S extends SchemaPrimitive
? SchemaPrimitiveToType<S>
: S extends Schema.Record
? SchemaRecordToType<S>
: S extends Schema.Array
? SchemaArrayToType<S>
: S extends Schema.Intersection
? SchemaIntersectionToType<S>
: S extends Schema.Union
? SchemaUnionToType<S>
: S;
Expected behavior:
export type SchemaToType<S extends Schema> =
S extends SchemaLiteral
? SchemaLiteralToType<S>
: S extends SchemaPrimitive
? SchemaPrimitiveToType<S>
: S extends Schema.Record
? SchemaRecordToType<S>
: S extends Schema.Array
? SchemaArrayToType<S>
: S extends Schema.Intersection
? SchemaIntersectionToType<S>
: S extends Schema.Union
? SchemaUnionToType<S>
: S;
Metadata
Metadata
Assignees
Labels
lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)