~~ lineWidth: 60 ~~
== should format everything in a function declaration ==
export async function
test<T, U>
(p, u): string
{
}

[expect]
export async function test<T, U>(p, u): string {
}

== should format a generator ==
export function* test (  )  :   string
{
}

[expect]
export function* test(): string {
}

== should format an async generator ==
async function* test () {
}

[expect]
async function* test() {
}

== should format a declare function with an export keyword ==
export declare function
test<T, U>
(p, u): string;

[expect]
export declare function test<T, U>(p, u): string;

== should format a declare function without an export keyword ==
declare function
test<T, U>
(p, u): string;

[expect]
declare function test<T, U>(p, u): string;

== should format the params as multi-line when the return type exceeds the line width ==
function testing(param: string, other: number): testing | this {
}

[expect]
function testing(
    param: string,
    other: number,
): testing | this {
}

== should format the params as multi-line when the return type exceeds the line width and there is only 1 param ==
function testing(param: string): testing | this | out | aLittleBitToExceedTheWidth {
}

[expect]
function testing(
    param: string,
): testing | this | out | aLittleBitToExceedTheWidth {
}

== should not move the close brace to the next line when empty and on the same line ==
function test() {}

[expect]
function test() {}

== should allow comments inside the braces when on the same line ==
function test() { /* test */ }

[expect]
function test() {/* test */}

== should support object destructuring in parameter with type ==
function t({ a, b }: { a: string; b: number; }) {
}

[expect]
function t({ a, b }: { a: string; b: number }) {
}

== should force multi-line parameters when exceeding the line width ==
function test(testing, thisOut, byExceeding, theLineWidth, testing) {
}

[expect]
function test(
    testing,
    thisOut,
    byExceeding,
    theLineWidth,
    testing,
) {
}

== should not be multi-line when not exceeding the line width ==
function test(testing, this) {
}

[expect]
function test(testing, this) {
}
