Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/generation/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6847,7 +6847,7 @@ fn gen_close_paren_with_type<'a>(opts: GenCloseParenWithTypeOptions<'a>, context
items.push_condition(if_true(
"newLineIfHeaderHangingAndTypeNodeMultipleLines",
Rc::new(move |context| {
if !has_type_node {
if !has_type_node || context.writer_info.is_start_of_line() {
return Some(false);
}

Expand Down
22 changes: 22 additions & 0 deletions tests/specs/issues/issue0382.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
~~ deno: true ~~
== should not add trailing blank line after parameters in function type ==
// this is weird code, but it's set to maintain type argument newlines
type TestingTestTesttttttt<T extends TestingTestingtestingTestingggg> =
T extends Testing ? (
...args: Test<T["parameters"]>
) => Other<
Test,
Test
>
: never;

[expect]
// this is weird code, but it's set to maintain type argument newlines
type TestingTestTesttttttt<T extends TestingTestingtestingTestingggg> =
T extends Testing ? (
...args: Test<T["parameters"]>
) => Other<
Test,
Test
>
: never;