microsoft / microsoft/TypeScript
typeToString doesn't respect TypeFormatFlags.MultilineObjectLiterals
@weswigham arbeitet bereits daran.
Seit 20.3.2025.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
### 🔎 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!
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.