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

feat(rome_js_formatter): Parenthesize assignments #3083

Merged
merged 2 commits into from
Aug 22, 2022

Conversation

MichaReiser
Copy link
Contributor

This PR implements the addition and removal of parentheses around assignments.

There are only very few cases where parentheses are necessary around assignments. Mainly:

  • TsTypeAssertionAssignment
  • TsAsAssignment
  • identifiers named async in for loops

This is why most of this PR is just boilerplate.

Average compatibility: 81.64 -> 81.73
Compatible lines: 78.42 -> 78.48

Tests

I added unit tests to the cases where parentheses are necessary

This PR implements the addition and removal of parentheses around assignments.

There are only very few cases where parentheses are necessary around assignments. Mainly:

* `TsTypeAssertionAssignment`
* `TsAsAssignment`
* identifiers named `async` in for loops

## Tests

I added unit tests to the cases where parentheses are necessary
@MichaReiser MichaReiser added the A-Formatter Area: formatter label Aug 18, 2022
@MichaReiser MichaReiser added this to the 0.9.0 milestone Aug 18, 2022
@MichaReiser MichaReiser temporarily deployed to aws August 18, 2022 12:17 Inactive
@MichaReiser MichaReiser mentioned this pull request Aug 18, 2022
17 tasks
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 18, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: c2754ae
Status: ✅  Deploy successful!
Preview URL: https://d8ba526b.tools-8rn.pages.dev
Branch Preview URL: https://feat-assignment-parentheses.tools-8rn.pages.dev

View logs

@github-actions
Copy link

github-actions bot commented Aug 18, 2022

@MichaReiser MichaReiser temporarily deployed to aws August 18, 2022 14:02 Inactive
@MichaReiser MichaReiser merged commit 9815467 into main Aug 22, 2022
@MichaReiser MichaReiser deleted the feat/assignment-parentheses branch August 22, 2022 07:14
IWANABETHATGUY pushed a commit to IWANABETHATGUY/tools that referenced this pull request Aug 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Formatter Area: formatter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants