DJLint / DJade : Thoughts? Similar but different?

Curious to which people prefer, really.

I’ve been using DjLint lately and have not been unhappy with it - but then stumbled across Djade again in some googling and was reminded of it’s ability to ‘upgrade’ template bits that are deprecated.

I used the two on a project I’ve been working on and found a couple difference that made me wonder: what does everyone else use and/or prefer?

I like the fact that Djade alphabetizes the load tag in the templates and that it places a space before blocks. Djlint doesn’t alphabetize the load tag (which is unimportant to me), but Djlint removes spaces before blocks (which I don’t care for as much).

Otherwise they seem to both do the job and do it well.

I was curious if others have specific use cases where they prefer one or the other and why.

I really like djLint and use it in all my projects. I think it’s more opinionated that Djade which you may or may not like.

I create a djlint.toml in my project folders, usually with something like this:

format_css = true
format_js = true
ignore = "H021,H031,H030"
indent = 2
max_line_length = 120

And then I hit save and just let the formatter format my template based on the rules.

The first time you use it, the formatter will probably aggressively change your template to match the rules, which can be a bit jarring. But after a while you get used to it and let it make the formatting decisions for you.

One of the more niche features that comes in handy with djLint is that you can configure custom blocks, so if you’re using a plugin or template tag that implements its own block type, then djLint won’t break the formatting of this.