Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fmt: support formatting css inside styled-tagged template literal #26880

Open
kt3k opened this issue Nov 15, 2024 · 1 comment
Open

fmt: support formatting css inside styled-tagged template literal #26880

kt3k opened this issue Nov 15, 2024 · 1 comment
Labels
deno fmt Related to the "deno fmt" subcommand or dprint suggestion suggestions for new features (yet to be agreed) upstream Changes in upstream are required to solve these issues

Comments

@kt3k
Copy link
Member

kt3k commented Nov 15, 2024

Input script:

const Bar = styled.div`
  margin: 1px;
    padding: 2px;
`;

Prettier output:

const Bar = styled.div`
  margin: 1px;
  padding: 2px;
`;

deno fmt output (no change):

const Bar = styled.div`
  margin: 1px;
    padding: 2px;
`;

Deno now has builtin css formatter. I think deno fmt should format the css code inside tagged template literals. (prettier seems detecting the embedded language from the tag symbol)


Note: This issue comes from the user interview with some enterprise tech team. This is the blocker for them to use deno fmt for their frontend code base.

@bartlomieju bartlomieju added suggestion suggestions for new features (yet to be agreed) deno fmt Related to the "deno fmt" subcommand or dprint labels Nov 15, 2024
@bartlomieju
Copy link
Member

dprint/dprint-plugin-typescript#683

@bartlomieju bartlomieju added the upstream Changes in upstream are required to solve these issues label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deno fmt Related to the "deno fmt" subcommand or dprint suggestion suggestions for new features (yet to be agreed) upstream Changes in upstream are required to solve these issues
Projects
None yet
Development

No branches or pull requests

2 participants