Back to Prettier

19102

changelog_unreleased/flow/19102.md

3.9.0495 B
Original Source

Add support for writeonly, in, and out variance modifiers (#19102 by @marcoww6)

Support new Flow variance syntax: writeonly on object type properties/indexers, and in T/out T on type parameters.

<!-- prettier-ignore -->
jsx
// Input
type T = {writeonly foo: string};
type Contravariant<in T> = T;
type Covariant<out T> = T;

// Prettier stable
// SyntaxError

// Prettier main
type T = { writeonly foo: string };
type Contravariant<in T> = T;
type Covariant<out T> = T;