StyLua icon indicating copy to clipboard operation
StyLua copied to clipboard

Improve formatting for table literals with long table types

Open znotfireman opened this issue 1 year ago • 0 comments

Expected Stylua to format the following as such:

local thisWorksOnlyWith: {
  {
    longNamesAnd: any,
    itShouldNotPutThe: any,
    curlyBracketsOnAnotherLine: any,
  }
} = {}

Actually formats as below with curly braces on another line:

local thisWorksOnlyWith: {
  {
    longNamesAnd: any,
    itShouldNotPutThe: any,
    curlyBracketsOnAnotherLine: any,
  }
} =
  {}
  • Seems to only work with long lines
  • Indexers also cause this e.g. [any]: { ... } will cause this

znotfireman avatar Aug 01 '24 09:08 znotfireman