Open doox911 opened 1 year ago
Sorry for my delay. Do you mean the operator position? You can use the "conditionalExpression.operatorPosition"
configuration for that (see https://dprint.dev/plugins/typescript/config/ and search for "operatorPosition").
Or are you wondering how to indent the second conditional expression? It's not possible to do that at the moment.
Yes, it is nesting(second conditional expression) that interests me. Then let it be a wish for improvement)!
@dsherret what option can i use to maintain the formatting below?
/**
* @file Type Definitions - Writable
* @module tutils/types/Writable
*/
/**
* Construct a type where all properties of `T` are writable.
*
* This is the opposite of {@linkcode Readonly}.
*
* @todo examples
*
* @template T - Type to evaluate
*/
type Writable<T> = T extends unknown
? { -readonly [K in keyof T]: T[K] }
: never
export type { Writable as default }
i tried changing operatorPosition
(and its variants) to maintain
, but the new formatting is still ugly. the only workaround is adding dprint-ignore
comments, but that of course ignores more than what i am intending to. in my case, i have to add 80+ comments for one project.
edit: i updated the playground link to include more than just the above example. i'm trying to migrate from prettier, but i'm finding that all conditional type formatting results are less than desirable. line break/indentation removal is making my code less readable.
edit 2: i read through #450. from what i understand, that pr may actually fix my issue. is that correct?
For example:
Language: Javascript, Typescript, Files: Vue, React, jsx and tsx.