Skip to content

typeToString doesn't respect TypeFormatFlags.MultilineObjectLiteralsΒ #61348

@adrianstephens

Description

@adrianstephens

πŸ”Ž Search Terms

typeToString

πŸ•— Version & Regression Information

This is the behavior in every version I tried, and I reviewed the FAQ for entries about typeToString

⏯ Playground Link

No response

πŸ’» Code

const result = typeChecker.typeToString(
  type,
  enclosingDeclaration,
  ts.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
  | ts.TypeFormatFlags.NoTruncation
  | ts.TypeFormatFlags.MultilineObjectLiterals
)

πŸ™ Actual behavior

When type is the type of an object literal, the ts.TypeFormatFlags.MultilineObjectLiterals flag causes multiple spaces to be generated between the properties, but not newlines.

πŸ™‚ Expected behavior

When type is the type of an object literal, the ts.TypeFormatFlags.MultilineObjectLiterals flag should cause newlines to be generated between the properties.

Additional information about the issue

I'm reporting this because on investigation I found the problem, but in order to generate a PR, I need an issue to refer to!

Metadata

Metadata

Assignees

Labels

Needs InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions