Rewriter: Implement tailwind-class-sorter built-in rewriter#760
Merged
Rewriter: Implement tailwind-class-sorter built-in rewriter#760
tailwind-class-sorter built-in rewriter#760Conversation
tailwind-class-sorter built-in rewriter`tailwind-class-sorter built-in rewriter
marcoroth
added a commit
that referenced
this pull request
Nov 1, 2025
Building on #759 and #760, this pull request integrates the `@herb-tools/tailwind-css-sorter` package into the `@herb-tools/formatter`, by using the built-in `tailwind-css-sorter` rewriter from the `@herb-tools/rewriter` package. Users can set the `tailwind-class-sorter` rewriter under the `formatter` section in the `.herb.yml` configuration file. ```diff formatter: enabled: true + rewriter: + pre: + - tailwind-class-sorter ``` Since this is just a formatter configuration option, it will also work in the `textDocument/formatting` request in the language server. https://github.com/user-attachments/assets/57979d1e-88ac-421e-8551-1af82de14f1b Additionally, users can put custom rewriters in `.herb/rewriters/*` and then reference them by filename in the `rewriter` section of the configuration. Resolves #671
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Building on top of #759, this pull request implements a
tailwind-class-sorterrewriter that's going to be built-in to the@herb-tools/rewriterpackage.Other tools will be able to refer to this built-in rewriter just by its name
tailwind-class-sorter. This is going to enable us to plug it in to the@herb-tools/formatter(see #671).Example: