microsoft / microsoft/TypeScript

typeToString doesn't respect TypeFormatFlags.MultilineObjectLiterals

Ouverte
#61,348 0 commentaires 1 réaction 1 personne assignée Voir sur GitHub

@weswigham y travaille déjà.

Depuis le 20/3/2025.

Needs Investigation
Langage dominant
Go
Étoiles
111k
Forks
14.3k
Merge moyen
2 j 4 h
PR mergées (30 j)
132

Description

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

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.