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

deno-fmt: move imports to top, sort tailwind classes #21617

Open
guy-borderless opened this issue Dec 17, 2023 · 7 comments
Open

deno-fmt: move imports to top, sort tailwind classes #21617

guy-borderless opened this issue Dec 17, 2023 · 7 comments
Labels
deno fmt Related to the "deno fmt" subcommand or dprint upstream Changes in upstream are required to solve these issues

Comments

@guy-borderless
Copy link

I'm missing two formatting options which prettier solves via a plugin mechanism:

  1. prettier-plugin-tailwindcss is rather important for tailwind dx
  2. move imports to top of file: in a large file, just past the import above the function you're working on, and on save it's at the top. It's more maintainable to have imports at the top.
@littledivy littledivy added upstream Changes in upstream are required to solve these issues deno fmt Related to the "deno fmt" subcommand or dprint labels Dec 17, 2023
@bartlomieju
Copy link
Member

@dsherret any thoughts on that?

@guy-borderless
Copy link
Author

also note this:
biomjs
and this: sql

@DaniGuardiola
Copy link

y'all are welcome to take inspiration from my implementation of tailwind class sorting in biome once done (note: work in progress, lots to do still) - it is tailwind labs approved :)

@guy-borderless
Copy link
Author

rustywind

@felix-schindler
Copy link

this would be great for the dx

@wiesson
Copy link

wiesson commented Sep 25, 2024

I also like to migrate to the Deno 2.0 "stack" and get rid of a lot of dependencies, unfortunately I also use prettier-plugin-tailwindcss a lot and it really helps me with the only downside I have with tailwind - keep an overview of all classes.

https://docs.deno.com/runtime/fundamentals/linting_and_formatting/#formatting says

Deno’s built-in formatter, deno fmt, uses the powerful Prettier engine to ensure that your code is always clean, readable, and consistent.

I'm wondering what's required to enable prettier-plugins 🤔

@marvinhagemeister - any hint where I could start looking? (Never really looked into Denos source and I only used it for some hello world stuff and some scripts / data transforming)

@marvinhagemeister
Copy link
Contributor

Deno uses dprint under the hood for formatting. It's Rust-based formatter were languages are plugins. The one for TypeScript and JavaScript can be found here: https://github.com/dprint/dprint-plugin-typescript

There is an upstream issue about tailwind formatting on that repo: dprint/dprint-plugin-typescript#552

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 upstream Changes in upstream are required to solve these issues
Projects
None yet
Development

No branches or pull requests

7 participants