You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm considering switching from prettier do dprint on a frontend react project, but one thing is stopping me: pettier formats code in tagged templates for styled-components but dprint doesn't
I wonder if it would be possible to delegate formatting of these to prettier (or any other pluggin) while using dprint for everything else? If something like this could be done in a general and configurable way it would help fill in missing functionality until it’s added to dprint itself
This comment was written by AI. If this is a mistake, please comment on this issue.
Implemented in #792 and #838. styled-components templates (ex. styled.div, styled(X), .attrs()) are now detected and their CSS is formatted by the CSS plugin in your dprint config (ex. malva). See the taggedTemplate.formatEmbedded and taggedTemplate.embeddedLanguages options.
This is on main but isn't released yet, so it will be in the next release after 0.96.1.
Activity
adrian-gierakowski commentedon Aug 22, 2024
I wonder if it would be possible to delegate formatting of these to prettier (or any other pluggin) while using dprint for everything else? If something like this could be done in a general and configurable way it would help fill in missing functionality until it’s added to dprint itself
dsherret commentedon Nov 4, 2026
Warning
This comment was written by AI. If this is a mistake, please comment on this issue.
Implemented in #792 and #838. styled-components templates (ex.
styled.div,styled(X),.attrs()) are now detected and their CSS is formatted by the CSS plugin in your dprint config (ex. malva). See thetaggedTemplate.formatEmbeddedandtaggedTemplate.embeddedLanguagesoptions.This is on main but isn't released yet, so it will be in the next release after 0.96.1.