Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typeToString doesn't respect TypeFormatFlags.MultilineObjectLiterals #61348

Open
adrianstephens opened this issue Mar 4, 2025 · 0 comments Β· May be fixed by #61349
Open

typeToString doesn't respect TypeFormatFlags.MultilineObjectLiterals #61348

adrianstephens opened this issue Mar 4, 2025 · 0 comments Β· May be fixed by #61349

Comments

@adrianstephens
Copy link

πŸ”Ž 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!

@adrianstephens adrianstephens linked a pull request Mar 4, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant