~~ lineWidth: 80 ~~
== 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 return type as hanging when it's hanging ==
function testing(param: string, other: number, finalParameter: string): testing | this {

}

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

== 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, thisOuttttt) {
}

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

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

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