Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Computed member expressions #2431

Closed
Tracked by #2403
MichaReiser opened this issue Apr 13, 2022 · 0 comments · Fixed by #2517
Closed
Tracked by #2403

Computed member expressions #2431

MichaReiser opened this issue Apr 13, 2022 · 0 comments · Fixed by #2517
Assignees
Labels
A-Formatter Area: formatter good first issue Good for newcomers

Comments

@MichaReiser
Copy link
Contributor

MichaReiser commented Apr 13, 2022

Rome doesn't break long computed member expressions if they exceed the configured max line width whereas Prettier does Playground.

Input

x.very.long.chain.of.static.members.that.goes.on.for.ever.I.mean.it.for.ever["and"].even.longer.than.that.and["rome"].doesnt.supportit

x.very.long.chain.of.static.members.that.goes.on.for.ever.I.mean.it.for.ever[and()].even.longer.than.that.and["rome"].doesnt.supportit

x["very"]["long"]["chain"]["of"]["computed"]["members"]["that"]["goes"]["on"]["for"]["ever"]["I"]["mean"]["it"]["for"]["ever"]["and"]["even"]["longer"]["than"]["that"]

Prettier

x.very.long.chain.of.static.members.that.goes.on.for.ever.I.mean.it.for.ever[
	"and"
].even.longer.than.that.and["rome"].doesnt.supportit;

x.very.long.chain.of.static.members.that.goes.on.for.ever.I.mean.it.for.ever[
	and()
].even.longer.than.that.and["rome"].doesnt.supportit;

x["very"]["long"]["chain"]["of"]["computed"]["members"]["that"]["goes"]["on"][
	"for"
]["ever"]["I"]["mean"]["it"]["for"]["ever"]["and"]["even"]["longer"]["than"][
	"that"
];

Rome

x.very.long.chain.of.static.members.that.goes.on.for.ever.I.mean.it.for.ever["and"].even.longer.than.that.and["rome"].doesnt.supportit;

x.very.long.chain.of.static.members.that.goes.on.for.ever.I.mean.it.for.ever[and()].even.longer.than.that.and["rome"].doesnt.supportit;

x["very"]["long"]["chain"]["of"]["computed"]["members"]["that"]["goes"]["on"]["for"]["ever"]["I"]["mean"]["it"]["for"]["ever"]["and"]["even"]["longer"]["than"]["that"];

Expected

Rome's formatting to match Prettier's

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Formatter Area: formatter good first issue Good for newcomers
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants