~~ lineWidth: 50 ~~
== should format different kinds of class methods ==
abstract class Test {
    constructor() {
        super(5, 4);
    }

    @dec
    public static async method1(): string {
        // test
    }

    public static async *method2() {
    }

    ["method3"]?() {
    }

    method4<T>() {
    }

    "method5"() {
    }

    6() {
        // testing
    }

    method7() {
        console.log("test");
    }

    method8(): string | number | string | number | string {
    }

    get getSet(): string {
    }

    set getSet(value: string) {
    }
}

[expect]
abstract class Test {
    constructor() {
        super(5, 4);
    }

    @dec
    public static async method1(): string {
        // test
    }

    public static async *method2() {
    }

    ["method3"]?() {
    }

    method4<T>() {
    }

    "method5"() {
    }

    6() {
        // testing
    }

    method7() {
        console.log("test");
    }

    method8(): string | number | string | number
        | string
    {
    }

    get getSet(): string {
    }

    set getSet(value: string) {
    }
}

== should format the return type as hanging when it's hanging ==
class Test {
    method(param: string): test | other | number {
    }
}

[expect]
class Test {
    method(param: string): test | other
        | number
    {
    }
}

== should format the return type on the same line when the rest of the header is hanging ==
class Test {
    method(param: string, otherTestinginging: string): test | other {
    }
}

[expect]
class Test {
    method(param: string,
        otherTestinginging: string): test | other
    {
    }
}

== should format the return type on a new line when it's hanging and the rest of the header is hanging ==
class Test {
    method(param: string, otherTestinginging: string): test | other | testing {
    }
}

[expect]
class Test {
    method(param: string,
        otherTestinginging: string
    ): test | other | testing {
    }
}
