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

refactor(rome_js_formatter): Part 6: JS Comments formatting #3244

Merged
merged 3 commits into from
Sep 20, 2022

Conversation

MichaReiser
Copy link
Contributor

Summary

This PR is part of the comments refactor #3227.

This PR implements the integration of the comments formatting into the JavaScript formatter framework (not the specific nodes).

  • It implements custom rules where comments should be placed for situations where CommentPlacement::Default isn't adequate (comments.rs)
  • Refactors FormatNodeRule to use the new format_leading_comments, format_trailing_comments, and format_dangling_comments builder.
  • It adds hooks to FormatNodeRule to override the comments formatting and suppressed handling (brings support for JSX Suppression comments)

@MichaReiser MichaReiser added the A-Formatter Area: formatter label Sep 16, 2022
@MichaReiser MichaReiser added this to the 0.10.0 milestone Sep 16, 2022
Base automatically changed from refactor/comments-formatting to refactor/comments September 20, 2022 12:29
@MichaReiser MichaReiser merged commit 4a697b2 into refactor/comments Sep 20, 2022
@MichaReiser MichaReiser deleted the refactor/js-comments-formatting branch September 20, 2022 16:28
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