Note: Here I've used 65 as print width to demonstrate the issue.
Input:
class MyContainerComponent {
@ContentChildren(MyComponent) components: QueryList<MyComponent>;
}
Output:
class MyContainerComponent {
@ContentChildren(MyComponent) components: QueryList<
MyComponent
>;
}
Expected:
class MyContainerComponent {
@ContentChildren(MyComponent)
components: QueryList<MyComponent>;
}
My reasoning here is that I think keeping the type annotation whole should take precedence over the decorator statement. Further, this is the behavior we would see if we added another decorator:
class MyContainerComponent {
@Other()
@ContentChildren(MyComponent)
components: QueryList<MyComponent>;
}
I also noticed there's yet another behavior if we decrease print width to 50:
class MyContainerComponent {
@ContentChildren(
MyComponent
) components: QueryList<MyComponent>;
}
To me this doesn't seem consistent with the behavior if we, for example, add another decorator. I believe giving a lower cost to splitting between decorator and property should improve consistency.
Reproduction link can be found here.
Note: Here I've used
65as print width to demonstrate the issue.Input:
Output:
Expected:
My reasoning here is that I think keeping the type annotation whole should take precedence over the decorator statement. Further, this is the behavior we would see if we added another decorator:
I also noticed there's yet another behavior if we decrease print width to
50:To me this doesn't seem consistent with the behavior if we, for example, add another decorator. I believe giving a lower cost to splitting between decorator and property should improve consistency.
Reproduction link can be found here.