dprint-plugin-typescript
dprint-plugin-typescript copied to clipboard
Sort JSX `classNames` Order
I came across this video regarding a Prettier plugin for sorting TailwindCSS class names. Thought I might share it, incase it's a desirable feature for Dprint as well.
- <div classNames="c b a">
+ <div classNames="a b c">
<span>Hello Dprint issues!</span>
</div>
The one concern I'd have about this feature: it's domain-specific. This doesn't seem very applicable to JS/TS at large. But for front-end web developers, this would be quite valuable! Perhaps a config flag such as the following:
...
"typscript": {
"jsxStringPropReorder": {
"classNames": "alphabetical"
}
}
...
Curious to hear anyone's thoughts.