microsoft / microsoft/TypeScript

typeToString doesn't respect TypeFormatFlags.MultilineObjectLiterals

Aperta
#61,348 0 commenti 1 reazione 1 assegnatario Vedi su GitHub

@weswigham ci sta già lavorando.

Dal 20/3/2025.

Needs Investigation
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
2g 4h
PR unite (30g)
132

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.