Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(format/html): attribute formatting #3783

Merged
merged 1 commit into from
Sep 14, 2024

Conversation

dyc3
Copy link
Contributor

@dyc3 dyc3 commented Sep 4, 2024

Summary

This PR aims to provide a good starting point for implementing attribute list formatting and to match prettier's behavior regarding html attributes and initializer clause quotes.
Prettier always uses double quotes for these, regardless of the actual quote style configuration (according to our playground).

Test Plan

Manually tested it using quick_test.

Planning to bring in prettier's unit tests in another PR.

@dyc3 dyc3 force-pushed the 09-04-feat_format_html_attribute_formatting branch from 6115cd3 to e4d6be5 Compare September 4, 2024 17:26
Copy link

codspeed-hq bot commented Sep 4, 2024

CodSpeed Performance Report

Merging #3783 will degrade performances by 8.2%

Comparing 09-04-feat_format_html_attribute_formatting (a336f88) with main (7ffc53f)

Summary

⚡ 1 improvements
❌ 1 regressions
✅ 105 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main 09-04-feat_format_html_attribute_formatting Change
parser_13571644119461115204.ts[cached] 6.6 ms 6.2 ms +6.31%
router_17129688031671448157.ts[uncached] 2.4 ms 2.6 ms -8.2%

@dyc3 dyc3 added the L-HTML Language: HTML label Sep 5, 2024
@dyc3 dyc3 force-pushed the 09-04-feat_format_html_attribute_formatting branch from e4d6be5 to 082126a Compare September 6, 2024 10:20
@github-actions github-actions bot added A-Project Area: project A-Tooling Area: internal tools labels Sep 6, 2024
Copy link
Contributor

github-actions bot commented Sep 6, 2024

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 48511 48511 0
Passed 47320 47320 0
Failed 1191 1191 0
Panics 0 0 0
Coverage 97.54% 97.54% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 40 40 0
Passed 37 37 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.50% 92.50% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6569 6569 0
Passed 2202 2202 0
Failed 4367 4367 0
Panics 0 0 0
Coverage 33.52% 33.52% 0.00%

ts/babel

Test result main count This PR count Difference
Total 671 671 0
Passed 599 599 0
Failed 72 72 0
Panics 0 0 0
Coverage 89.27% 89.27% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18418 18418 0
Passed 14100 14100 0
Failed 4318 4318 0
Panics 0 0 0
Coverage 76.56% 76.56% 0.00%

@dyc3 dyc3 force-pushed the 09-04-feat_format_html_attribute_formatting branch from 082126a to 251d09e Compare September 6, 2024 10:33
@dyc3 dyc3 changed the title feat(format/html): minimal attribute formatting feat(format/html): attribute formatting Sep 9, 2024
@dyc3 dyc3 force-pushed the 09-04-feat_format_html_attribute_formatting branch 2 times, most recently from f156dab to a64ff8e Compare September 10, 2024 09:59
@github-actions github-actions bot removed A-Project Area: project A-Tooling Area: internal tools labels Sep 10, 2024
@dyc3 dyc3 marked this pull request as ready for review September 10, 2024 10:04
@dyc3 dyc3 requested review from a team September 10, 2024 10:04
@dyc3 dyc3 force-pushed the 09-04-feat_format_html_attribute_formatting branch from a64ff8e to da90cc9 Compare September 10, 2024 13:33
@dyc3 dyc3 force-pushed the 09-04-feat_format_html_attribute_formatting branch from da90cc9 to a336f88 Compare September 10, 2024 14:02
@dyc3 dyc3 added the A-Formatter Area: formatter label Sep 10, 2024
@dyc3 dyc3 merged commit ce7d090 into main Sep 14, 2024
14 of 15 checks passed
@dyc3 dyc3 deleted the 09-04-feat_format_html_attribute_formatting branch September 14, 2024 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Formatter Area: formatter L-HTML Language: HTML
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants