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

feat(rome_js_formatter): Object Pattern Formatting #3405

Merged
merged 4 commits into from
Oct 12, 2022

Conversation

MichaReiser
Copy link
Contributor

This PR aligns the object pattern formatting with prettier. Mainly the logic when to expand a pattern over multiple lines.

This PR further adds an extension trait for Option<SyntaxNode<L>> that implements a kind helper. I don't remember how many times I've written node.parent().map(|p| p.kind())... This new extension trait now allows to simply write node.parent().kind().

Tests

I verified that the tests mentioned in #3295 are fixed.

Average compatibility: 91.84 -> 91.98
Compatible lines: 93.85 -> 93.95

This PR aligns the object pattern formatting with prettier. Mainly the logic when to expand a pattern over multiple lines.

This PR further adds an extension trait for `Option<SyntaxNode<L>>` that implements a `kind` helper. I don't remember how many times I've written `node.parent().map(|p| p.kind())`... This new extension trait now allows to simply write `node.parent().kind()`.

## Tests

I verified that the tests mentioned in #3295 are fixed.

**Average compatibility**: 91.84 -> 91.98
**Compatible lines**: 93.85 -> 93.95
@MichaReiser MichaReiser requested a review from a team October 12, 2022 09:26
@netlify
Copy link

netlify bot commented Oct 12, 2022

Deploy Preview for rometools canceled.

Name Link
🔨 Latest commit f30644d
🔍 Latest deploy log https://app.netlify.com/sites/rometools/deploys/6346a586973f0a000937bb57

@MichaReiser MichaReiser temporarily deployed to netlify-playground October 12, 2022 09:26 Inactive
@MichaReiser MichaReiser added the A-Formatter Area: formatter label Oct 12, 2022
@MichaReiser MichaReiser added this to the 10.0.0 milestone Oct 12, 2022
@MichaReiser MichaReiser temporarily deployed to netlify-playground October 12, 2022 09:26 Inactive
@github-actions
Copy link

github-actions bot commented Oct 12, 2022

@github-actions
Copy link

Parser conformance results on ubuntu-latest

js/262

Test result main count This PR count Difference
Total 45879 45879 0
Passed 44939 44939 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%

symbols/microsoft

Test result main count This PR count Difference
Total 5946 5946 0
Passed 1621 1621 0
Failed 4325 4325 0
Panics 0 0 0
Coverage 27.26% 27.26% 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 12395 12395 0
Failed 3862 3862 0
Panics 0 0 0
Coverage 76.24% 76.24% 0.00%

@MichaReiser MichaReiser temporarily deployed to netlify-playground October 12, 2022 09:42 Inactive
@MichaReiser MichaReiser temporarily deployed to netlify-playground October 12, 2022 11:31 Inactive
@MichaReiser MichaReiser merged commit 1e66d03 into main Oct 12, 2022
@MichaReiser MichaReiser deleted the feat/object-pattern-formatting branch October 12, 2022 12:07
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
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载