microsoft / microsoft/TypeScript

typeToString doesn't respect TypeFormatFlags.MultilineObjectLiterals

Abierto
#61,348 0 comentarios 1 reacción 1 asignado Ver en GitHub

@weswigham ya está trabajando en esto.

Desde el 20/3/2025.

Needs Investigation
Lenguaje dominante
Go
Estrellas
111k
Forks
14.3k
Merge medio
2 d 4 h
PR fusionados (30 d)
132

Descripción

### 🔎 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

```ts
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!

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.