3 ms·
For Django projects, what's fast that will cover Python, HTML, CSS and JavaScript files? Ruff only does Python?
by seanwilson 2y ago
For Django projects, what's fast that will cover Python, HTML, CSS and JavaScript files? Ruff only does Python?
- bobbylarrybobby 2y agoPrettier can do HTML CSS and JS but I don't think there's any one tool that can do it all. (It would be interesting if there were something like a tree sitter for auto formatting)
- mdaniel 2y agoI recently learned that tree-sitter does not have a goal of accurately representing the whole source input, and thus as it currently stands could not be used for that purpose Now, whether a tree-sitter-esque ecosystem that is designed for source modeling could catch on like t-s did is a more interesting question
- zahlman 2y agoIf you already have tooling to cover each separately, why would it be better for it to be a single tool?
- seanwilson 2y agoDjango templates snippets get mixed inside CSS, JavaScript and HTML. So regular when CSS/JavaScript/HTML formatters get confused by those, it's not obvious what combination to use. I know of djLint but it's pretty slow.
- dethos 2y agoFor Django projects, I would say DjLint [1]. It doesn't cover all you asked, but makes the job of writing the templates (HTML) much more pleasant. [1] https://djlint.com/ https://djlint.com/