Files
dioxus/packages/autofmt
hideselfviewandDmitry Minkovsky 3a60140dff fix: prevent dx fmt from adding trailing whitespace to blank lines (#5224)
This fixes a conflict between dx fmt and cargo fmt (rustfmt). Previously,
dx fmt would add indentation whitespace to blank lines inside RSX blocks,
but cargo fmt removes trailing whitespace from all lines. This made it
impossible for code to satisfy both formatters.

The fix skips adding indentation to empty lines in two places:
1. When indenting formatted RSX blocks inside expressions
2. When reassembling the final formatted output

Fixes #5223

Co-authored-by: Dmitry Minkovsky <dminkovsky@gmail.com>
2026-01-16 15:47:47 -08:00
..
2025-10-30 21:26:01 -07:00

dioxus-autofmt

Crates.io MIT licensed Build Status Discord chat

Website | Guides | API Docs | Chat

Overview

dioxus-autofmt provides a pretty printer for the rsx syntax tree.

This is done manually with a via set of formatting rules. The output is not guaranteed to be stable between minor versions of the crate as we might tweak the output.

dioxus-autofmt provides an API to perform precision edits as well as just spit out a block of formatted RSX from any RSX syntax tree. This is used by the rsx-rosetta crate which can accept various input languages and output valid RSX.

Contributing

  • Report issues on our issue tracker.
  • Join the discord and ask questions!

License

This project is licensed under the MIT license.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Dioxus by you shall be licensed as MIT without any additional terms or conditions.