-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New generics printing causes very long lines #5370
Copy link
Copy link
Labels
lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
Prettier 1.15.1
Playground link
--parser babylonInput:
const durabilityMetricsSelectable: Immutable.OrderedSet<
SomeReportingMetric,
> = myExperienceSelectable.concat(otherDurabilityMetricsSelectable);Output:
const durabilityMetricsSelectable: Immutable.OrderedSet<SomeReportingMetric> = myExperienceSelectable.concat(
otherDurabilityMetricsSelectable
);Expected behavior:
Ideally, we should make it work like this:
const durabilityMetricsSelectable: Immutable.OrderedSet<SomeReportingMetric> =
myExperienceSelectable.concat(otherDurabilityMetricsSelectable);This is hard, I know prettier hasn't been doing breaking after equals because it's hard to know what's on its left side, but maybe there's a heuristic here? (same one as the one causing the generic to be one line?).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.