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

fix(rome_js_formatter): break computed expressions like prettier #2517

Merged
merged 1 commit into from
May 2, 2022

Conversation

ematipico
Copy link
Contributor

Summary

Fixed #2431

This PR does two things:

  • it changes the way nested computed properties are formatted/navigated; it uses the same trick we use in the sequence expressions;
  • creates a group around the computed properties so they break when they exceed the line width

Test Plan

Added new tests that cover the case we want to fix

@ematipico ematipico temporarily deployed to aws April 28, 2022 16:27 Inactive
@ematipico ematipico temporarily deployed to aws April 28, 2022 16:28 Inactive
@github-actions
Copy link

Parser conformance results on ubuntu-latest

js/262

Test result main count This PR count Difference
Total 45878 45878 0
Passed 44938 44938 0
Failed 940 940 0
Panics 0 0 0
Coverage 97.95% 97.95% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 39 39 0
Passed 36 36 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.31% 92.31% 0.00%

ts/babel

Test result main count This PR count Difference
Total 588 588 0
Passed 519 519 0
Failed 69 69 0
Panics 0 0 0
Coverage 88.27% 88.27% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 16257 16257 0
Passed 12391 12391 0
Failed 3866 3866 0
Panics 0 0 0
Coverage 76.22% 76.22% 0.00%

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Apr 28, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: c733d6e
Status: ✅  Deploy successful!
Preview URL: https://3a9f9165.tools-8rn.pages.dev

View logs

@github-actions
Copy link

github-actions bot commented Apr 28, 2022

@MichaReiser MichaReiser merged commit 58ce2f2 into main May 2, 2022
@MichaReiser MichaReiser deleted the fix/computed-properties branch May 2, 2022 08:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Computed member expressions
2 participants