dprint-plugin-typescript icon indicating copy to clipboard operation
dprint-plugin-typescript copied to clipboard

Tagged template formatting support

Open dsherret opened this issue 1 year ago • 4 comments

Tagged templates should be able to format with the host formatter similar to how things work for code blocks in dprint-plugin-markdown.

Related issues:

  • https://github.com/dprint/dprint-plugin-typescript/issues/9
  • https://github.com/dprint/dprint-plugin-typescript/issues/643

dsherret avatar Aug 29 '24 13:08 dsherret

I think we can put the host formatter closure into Context struct, but this closure needs to be passed via:

  • https://github.com/dprint/dprint-plugin-typescript/blob/45b3bd92ce7e19e46068de8abfc44ccccd752fba/src/generation/generate.rs#L34
  • https://github.com/dprint/dprint-plugin-typescript/blob/45b3bd92ce7e19e46068de8abfc44ccccd752fba/src/generation/generate.rs#L28
  • https://github.com/dprint/dprint-plugin-typescript/blob/45b3bd92ce7e19e46068de8abfc44ccccd752fba/src/format_text.rs#L73
  • https://github.com/dprint/dprint-plugin-typescript/blob/45b3bd92ce7e19e46068de8abfc44ccccd752fba/src/format_text.rs#L64
  • https://github.com/dprint/dprint-plugin-typescript/blob/45b3bd92ce7e19e46068de8abfc44ccccd752fba/src/format_text.rs#L42

g-plane avatar Aug 30 '24 03:08 g-plane

My team is currently starting a new frontend project and lack of styled-component support is preventing us from using dprint, which is a pitty since we are already using it for all backend code.

adrian-gierakowski avatar Oct 15 '24 09:10 adrian-gierakowski

Same here!

textpain avatar Oct 26 '24 18:10 textpain

Is this related to #694?

harrysolovay avatar Feb 27 '25 12:02 harrysolovay