Replies: 1 comment
-
There is this project https://github.com/ksss/rubocop-on-rbs which parses rbs, so there is precedence for using rubocop for something that isn't ruby. Although, rbs and ruby are quite similar which isn't the case for html. I feel like it would work with some effort but haven't actually looked into it myself. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Hi RuboCop team and community,
There’s currently a lack of good linting or sorting tools for Tailwind CSS classes in Ruby ecosystems—especially for Ruby, ERB, Haml, and Slim files. Most existing solutions (like the Prettier Tailwind plugin) don’t work with these formats, and there isn’t a unified linter available.
Given RuboCop’s strong parsing capabilities and its extensible architecture, I’m considering whether it would be viable to implement a Tailwind class linter as a RuboCop extension. However, I’m not sure about the best approach, and I don’t know if this is the right place to build such a tool.
So far, the only practical solution I’ve found would be to wrap the Prettier Tailwind plugin, which would require Node.js and leverage Tailwind’s own class sorting logic. This isn’t ideal, but it’s the most realistic option for now.
If this linter were to be built as a RuboCop extension, it would primarily focus on:
Key question:
Other considerations:
I’d appreciate any advice, suggestions, or warnings from the RuboCop maintainers and community before going further.
References:
Thanks for your feedback!
Beta Was this translation helpful? Give feedback.
All reactions