~~ lineWidth: 60 ~~
== should format a single line statement ==
const t = ()   =>   7;

[expect]
const t = () => 7;

== should format with everything ==
const t = async <T, U>(p, u): string =>
{
};

[expect]
const t = async <T, U>(p, u): string => {
};

== should keep the body on a single line when formatted that way ==
const t = () => {   };

[expect]
const t = () => {};

== should support multiple line expressions ==
const t = () => true || false || true || false || true || false;

[expect]
const t = () =>
    true || false || true || false || true || false;

== should allow arrow functions without parens ==
const t = a => 5;

[expect]
const t = a => 5;

== should use parens when specified ==
const t = (a) => 5;

[expect]
const t = (a) => 5;

== should use parens when there is a type ==
const t = (a: string) => 5;

[expect]
const t = (a: string) => 5;

== should use parens when async and no parens ==
const t = async () => 5;

[expect]
const t = async () => 5;

== should not use parens when async and has no parens ==
const t = async a => 5;

[expect]
const t = async a => 5;

== should format the return type as hanging when it's hanging ==
const t = (param: string, other: number): testing | thisOutMore => {

}

[expect]
const t = (param: string, other: number): testing
    | thisOutMore =>
{
};

== should format the return type on the same line when the rest of the header is multi-line ==
const testing = (param: string, other: number, finalParameterThatIs: string): testing | this => {
}

[expect]
const testing = (
    param: string,
    other: number,
    finalParameterThatIs: string
): testing | this => {
};

== should format the return type on a new line when it's hanging and the rest of the header is multi-line ==
const testing = (param: string, other: number, finalParameterThatIsReallyReallyLong: string): testing | other | other | test | test | asdf | testingThisOut | testingThisOut => {
}

[expect]
const testing = (
    param: string,
    other: number,
    finalParameterThatIsReallyReallyLong: string
): testing | other | other | test | test | asdf
    | testingThisOut | testingThisOut =>
{
};

== should format arrow function containing an object expression ==
const test = (testing, thisOut) => ({
    test: 5,
    other: 10
});

[expect]
const test = (testing, thisOut) => ({
    test: 5,
    other: 10
});

== should not newline when the arrow is on a separate line -- previously would newline before sum, which was useless ==
const test = (testing, thisOut, with, somethingThatWillGo, multiLine) => sum(testing, thisOut, againWithSomethingThisisLong, testing);

[expect]
const test = (
    testing,
    thisOut,
    with,
    somethingThatWillGo,
    multiLine
) => sum(
    testing,
    thisOut,
    againWithSomethingThisisLong,
    testing
);
