prettier/tests/flow_generic/__snapshots__/jsfmt.spec.js.snap

366 lines
12 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`break.js 1`] = `
====================================options=====================================
parsers: ["flow", "babel"]
printWidth: 80
| printWidth
=====================================input======================================
var X = {
perform: function<
A, B, C, D, E, F, G,
T: (a: A, b: B, c: C, d: D, e: E, f: F) => G // eslint-disable-line space-before-function-paren
>(
method: T, scope: any,
a: A, b: B, c: C, d: D, e: E, f: F,
): G {
}
}
=====================================output=====================================
var X = {
perform: function<
A,
B,
C,
D,
E,
F,
G,
T: (a: A, b: B, c: C, d: D, e: E, f: F) => G // eslint-disable-line space-before-function-paren
>(method: T, scope: any, a: A, b: B, c: C, d: D, e: E, f: F): G {}
};
================================================================================
`;
exports[`break.js 2`] = `
====================================options=====================================
parsers: ["flow", "babel"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
var X = {
perform: function<
A, B, C, D, E, F, G,
T: (a: A, b: B, c: C, d: D, e: E, f: F) => G // eslint-disable-line space-before-function-paren
>(
method: T, scope: any,
a: A, b: B, c: C, d: D, e: E, f: F,
): G {
}
}
=====================================output=====================================
var X = {
perform: function<
A,
B,
C,
D,
E,
F,
G,
T: (a: A, b: B, c: C, d: D, e: E, f: F) => G, // eslint-disable-line space-before-function-paren
>(method: T, scope: any, a: A, b: B, c: C, d: D, e: E, f: F): G {},
};
================================================================================
`;
exports[`generic.js 1`] = `
====================================options=====================================
parsers: ["flow", "babel"]
printWidth: 80
| printWidth
=====================================input======================================
const identity = <T>(t: T): T => t;
const a = 1;
=====================================output=====================================
const identity = <T>(t: T): T => t;
const a = 1;
================================================================================
`;
exports[`generic.js 2`] = `
====================================options=====================================
parsers: ["flow", "babel"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
const identity = <T>(t: T): T => t;
const a = 1;
=====================================output=====================================
const identity = <T>(t: T): T => t;
const a = 1;
================================================================================
`;
exports[`interface.js 1`] = `
====================================options=====================================
parsers: ["flow", "babel"]
printWidth: 80
| printWidth
=====================================input======================================
interface A { 'C': string; }
interface B { "D": boolean; }
=====================================output=====================================
interface A {
C: string;
}
interface B {
D: boolean;
}
================================================================================
`;
exports[`interface.js 2`] = `
====================================options=====================================
parsers: ["flow", "babel"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
interface A { 'C': string; }
interface B { "D": boolean; }
=====================================output=====================================
interface A {
C: string;
}
interface B {
D: boolean;
}
================================================================================
`;
exports[`nullable.js 1`] = `
====================================options=====================================
parsers: ["flow", "babel"]
printWidth: 80
| printWidth
=====================================input======================================
function formatEntireFile(
fileVersion: FileVersion,
range: atom$Range,
): Promise<?{
newCursor?: number,
formatted: string,
}> {}
function foo(): Promise<?boolean> {}
=====================================output=====================================
function formatEntireFile(
fileVersion: FileVersion,
range: atom$Range
): Promise<?{
newCursor?: number,
formatted: string
}> {}
function foo(): Promise<?boolean> {}
================================================================================
`;
exports[`nullable.js 2`] = `
====================================options=====================================
parsers: ["flow", "babel"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
function formatEntireFile(
fileVersion: FileVersion,
range: atom$Range,
): Promise<?{
newCursor?: number,
formatted: string,
}> {}
function foo(): Promise<?boolean> {}
=====================================output=====================================
function formatEntireFile(
fileVersion: FileVersion,
range: atom$Range,
): Promise<?{
newCursor?: number,
formatted: string,
}> {}
function foo(): Promise<?boolean> {}
================================================================================
`;
exports[`single-identifier.js 1`] = `
====================================options=====================================
parsers: ["flow", "babel"]
printWidth: 80
| printWidth
=====================================input======================================
const longVariableName: Array<number> = this.foo.bar.baz.collider.body.vertices.reduce();
=====================================output=====================================
const longVariableName: Array<number> = this.foo.bar.baz.collider.body.vertices.reduce();
================================================================================
`;
exports[`single-identifier.js 2`] = `
====================================options=====================================
parsers: ["flow", "babel"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
const longVariableName: Array<number> = this.foo.bar.baz.collider.body.vertices.reduce();
=====================================output=====================================
const longVariableName: Array<number> = this.foo.bar.baz.collider.body.vertices.reduce();
================================================================================
`;
exports[`trailing.js 1`] = `
====================================options=====================================
parsers: ["flow", "babel"]
printWidth: 80
| printWidth
=====================================input======================================
type State = {
errors: Immutable.Map<
Ahohohhohohohohohohohohohohooh,
Fbt | Immutable.Map<ErrorIndex, Fbt>
>,
shouldValidate: boolean,
};
=====================================output=====================================
type State = {
errors: Immutable.Map<
Ahohohhohohohohohohohohohohooh,
Fbt | Immutable.Map<ErrorIndex, Fbt>
>,
shouldValidate: boolean
};
================================================================================
`;
exports[`trailing.js 2`] = `
====================================options=====================================
parsers: ["flow", "babel"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
type State = {
errors: Immutable.Map<
Ahohohhohohohohohohohohohohooh,
Fbt | Immutable.Map<ErrorIndex, Fbt>
>,
shouldValidate: boolean,
};
=====================================output=====================================
type State = {
errors: Immutable.Map<
Ahohohhohohohohohohohohohohooh,
Fbt | Immutable.Map<ErrorIndex, Fbt>,
>,
shouldValidate: boolean,
};
================================================================================
`;
exports[`type.js 1`] = `
====================================options=====================================
parsers: ["flow", "babel"]
printWidth: 80
| printWidth
=====================================input======================================
type F = <T>(T) => T;
type G = (<A, B>(A) => B);
type H = { 'A': string, "B": number };
=====================================output=====================================
type F = <T>(T) => T;
type G = <A, B>(A) => B;
type H = { A: string, B: number };
================================================================================
`;
exports[`type.js 2`] = `
====================================options=====================================
parsers: ["flow", "babel"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
type F = <T>(T) => T;
type G = (<A, B>(A) => B);
type H = { 'A': string, "B": number };
=====================================output=====================================
type F = <T>(T) => T;
type G = <A, B>(A) => B;
type H = { A: string, B: number };
================================================================================
`;
exports[`union.js 1`] = `
====================================options=====================================
parsers: ["flow", "babel"]
printWidth: 80
| printWidth
=====================================input======================================
type Foo = Promise<
{ ok: true, bar: string, baz: SomeOtherLongType } |
{ ok: false, bar: SomeOtherLongType }
>;
=====================================output=====================================
type Foo = Promise<
| { ok: true, bar: string, baz: SomeOtherLongType }
| { ok: false, bar: SomeOtherLongType }
>;
================================================================================
`;
exports[`union.js 2`] = `
====================================options=====================================
parsers: ["flow", "babel"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
type Foo = Promise<
{ ok: true, bar: string, baz: SomeOtherLongType } |
{ ok: false, bar: SomeOtherLongType }
>;
=====================================output=====================================
type Foo = Promise<
| { ok: true, bar: string, baz: SomeOtherLongType }
| { ok: false, bar: SomeOtherLongType },
>;
================================================================================
`;