bram209 / leptosfmt

A formatter for the leptos view! macro
Apache License 2.0
274 stars 30 forks source link

feat: Support rebinding the `view` macro name as a new local name. #17

Closed elliotwaite closed 9 months ago

elliotwaite commented 1 year ago

I rebind the view name as the local name v:

pub use leptos::view as v;

so that I can use:

v! { cx, "hi" }

It would be nice to have an option like --macro-ident to support this. For example:

leptosfmt --macro-ident v .

And a comma-separated list could be used to support multiple names:

leptosfmt --macro-ident view,v .

I'm not sure how popular this use case is, so for now I just created my own fork that supports the v! macro. But I thought I'd also open this feature request in case others would also find this option useful.