dprint-plugin-typescript icon indicating copy to clipboard operation
dprint-plugin-typescript copied to clipboard

Enforce consistent style for multi line, multi argument function calls

Open adrian-gierakowski opened this issue 2 years ago • 1 comments

I would like to enforce the following:

func(
  { 
    a: 1,
    b: 2,
  },
  { c: 3 },
)

And disallow the following, where the 2 consecutive arguments share the same line:

func({ 
  a: 1,
  b: 2,
}, { 
  c: 3
})

Currently to achieve the former I need to explicitly add a new line after the opening paren (and before the first opening brace). It’s fine when writing new code, however when converting large existing code bases with inconsistent style means a lot of manual adjustments. It would be great if this could be enforced for any multi line call with more than one arguments.

Similarly for array literals with elements being object or array literals.

Thanks!

adrian-gierakowski avatar Jun 09 '23 21:06 adrian-gierakowski

Lol, looks like I made a duplicate of my own issue 😂

adrian-gierakowski avatar Jun 09 '23 21:06 adrian-gierakowski