[Feature Request] Option to force multi-line formatting for long class strings #19235
ahmed-ghallap
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello team,
Thank you for developing this extremely useful Prettier plugin!
I would like to propose an option to force the class string to break into multiple lines, even if the string is shorter than Prettier's global
printWidth.🌟 The Proposed Feature
A new option, perhaps something like
tailwindForceMultiline: booleanortailwindClassBreak: 'always' | 'if-exceeds-print-width' (default), that would ensure each class (or a small group of related classes) is placed on its own line after the opening quote.💡 Justification and Use Case (The Tailwind Class Folding Benefit)
While Prettier's
printWidthhandles line wrapping, having all classes strictly on separate lines offers a huge benefit when using editor features like VS Code'stailwind-class-foldextension.[... 15 classes]).Example of desired output (after expansion):
Beta Was this translation helpful? Give feedback.
All reactions