TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Automatic class sorting with Prettier (2022)

98 pointsby ekiauhceover 1 year ago

8 comments

conaclosover 1 year ago
Biome [0], a fast Prettier-compatible formatter, is currently working on adding class sorting [1]. We expect to ship the feature with the next release (on February). We are discussing which options to provide for the feature (mainly on the Discord of Biome).<p>[0] <a href="https:&#x2F;&#x2F;biomejs.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;biomejs.dev&#x2F;</a> [1] <a href="https:&#x2F;&#x2F;github.com&#x2F;biomejs&#x2F;biome&#x2F;pull&#x2F;1362">https:&#x2F;&#x2F;github.com&#x2F;biomejs&#x2F;biome&#x2F;pull&#x2F;1362</a>
评论 #39045280 未加载
EspadaV9over 1 year ago
&gt; The plugin will respect your tailwind.config.js file and work with any Tailwind plugins you’ve installed, but _there is no way to change the sort order_.<p>Really like that they don&#x27;t give options to change the settings. Just one less thing to bike shed within teams. Really doesn&#x27;t matter what is picked, just as long as it is consistent (and not obviously stupid).
评论 #39039573 未加载
评论 #39039876 未加载
评论 #39039329 未加载
评论 #39039757 未加载
timenovaover 1 year ago
Does anyone know if it&#x27;s possible to get Tailwind class sorting in Elixir Phoenix HEEX templates. It would be a great addition to the Elixir formatter.<p>Maybe we could write a formatter plugin in Elixir that does the same thing if this one isn&#x27;t usable directly.
评论 #39039945 未加载
vinnymacover 1 year ago
In a similar vein, you can sort imports with Prettier using Trivago’s plugin.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;trivago&#x2F;prettier-plugin-sort-imports">https:&#x2F;&#x2F;github.com&#x2F;trivago&#x2F;prettier-plugin-sort-imports</a>
评论 #39041435 未加载
lcrzover 1 year ago
This blog post is from 2022.
评论 #39038968 未加载
tiffanyhover 1 year ago
Let&#x27;s add another step in our toolchain &amp; deployment bundle.<p>It saddens me to see people new to web development don&#x27;t realize that to deploy a webpage, all it takes is just uploading (SFTP) a single .html file onto a web server.<p>Nothing more is technically required than that, but we&#x27;ve made it so complex you&#x27;d never know.
评论 #39042825 未加载
评论 #39042958 未加载
评论 #39042976 未加载
评论 #39045317 未加载
评论 #39044267 未加载
paulddraperover 1 year ago
&gt; any classes in the base layer will be sorted first, followed by classes in the components layer, and then finally classes in the utilities layer<p>I guess you can get away with that because a tool can follow those rules.<p>But man, I &lt;3 alpha sort.
评论 #39039328 未加载
评论 #39042533 未加载
assimpleaspossiover 1 year ago
Both MDN and the W3C complain about Prettier putting closing slashes on HTML tags such as &lt;input &#x2F;&gt;. While allowed due to backward compatibility to XHTML, they have never been specified, do nothing, and browsers ignore them so it is pointless to put them there.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;validator&#x2F;validator&#x2F;wiki&#x2F;Markup-%C2%BB-Void-elements">https:&#x2F;&#x2F;github.com&#x2F;validator&#x2F;validator&#x2F;wiki&#x2F;Markup-%C2%BB-Vo...</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;orgs&#x2F;mdn&#x2F;discussions&#x2F;242">https:&#x2F;&#x2F;github.com&#x2F;orgs&#x2F;mdn&#x2F;discussions&#x2F;242</a>
评论 #39039507 未加载
评论 #39039776 未加载
评论 #39043314 未加载
评论 #39039942 未加载