Skip to content

Option to always wrap arguments as onePerLine with trailing commas #694

@RblSb

Description

@RblSb

Since trailing commas are implemented in most places, we can utilize it in formatter as style option like this:

function name(a:Int, b:Int):Void {} // format with default wrapping style from config

function name(
	a:Int,
	b:Int, // reformat with `onePerLine` when there is trailing comma
):Void {}

Same can be applied for function calls and arrays:

foo("abc");
foo(
	"abc",
);
final arr = ["banana", "orange"];
final arr = [
	"banana",
	"orange",
];

I think this also can be useful as default behavior to open more customization without touching line length rules and stuff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestwrappingIncorrect or undesirable wrapping

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions