-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Open
Labels
lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken
Description
Prettier 2.0.2
Playground link
--parser typescript
--print-width 100
--trailing-comma allInput:
type TypeName<T> =
T extends string ? "string" :
T extends number ? "number" :
T extends boolean ? "boolean" :
T extends undefined ? "undefined" :
T extends Function ? "function" :
T extends Array<any> ? "array" :
T extends null ? "null" :
T extends symbol ? "symbol" :
"object";Output:
type TypeName<T> = T extends string
? "string"
: T extends number
? "number"
: T extends boolean
? "boolean"
: T extends undefined
? "undefined"
: T extends Function
? "function"
: T extends Array<any>
? "array"
: T extends null
? "null"
: T extends symbol
? "symbol"
: "object";Expected behavior:
Keep the original formatting which is much nicer.
brunotestahy, Mateko, mkawalec, szymonkorytnicki, manuelurenah and 43 moreunicornwareBamblehorse and kubeBamblehorse and kubeBamblehorse and kube
Metadata
Metadata
Assignees
Labels
lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken