Feature
Template languages:
- New
askamaprofile for Askama (jinja-style templates in Rust). Rust expressions are never reformatted: function and{% set %}/{% let %}formatting are disabled sosome_macro!("foo")?, char literals'a'and tuples keep their exact spelling, and string quotes are never rewritten. The Flask-specificurl_forrules (J004/J018) don't apply. - New
teraprofile for Tera (Rust, used by Zola): jinja-style formatting plus Tera v2{% component %}/{% endcomponent %}blocks and single-tag{% set_global %}. The Flask-specificurl_forrules don't apply. MiniJinja needs no profile of its own - it is fully Jinja2-compatible, use--profile=jinja. - New
liquidprofile for Liquid (Shopify themes, Jekyll, Eleventy, the Rustliquidcrate).{% case %}/{% when %},{% capture %},{% tablerow %},{% form %},{% paginate %},{% highlight %}and{% unless %}/{% elsif %}indent correctly,{%- -%}whitespace control is handled, and the bodies of Shopify section tags ({% schema %},{% style %},{% javascript %},{% stylesheet %}) are left untouched - they contain JSON, CSS or JS rather than html. - The
golangprofile now indents template blocks:{{ if }},{{ range }},{{ with }},{{ block }}and{{ define }}indent their contents up to the matching{{ end }}, with{{ else }}/{{ else if }}as branches and the{{- -}}whitespace-control forms included. Blocks opened and closed on one line are left alone; single tags like{{ template }}and lookalike variables such as{{ .end }}are unaffected.
New linter rules:
- T040:
{% extends %}or{% include %}with a missing or empty template name - an error the engine only raises at render time, so the typo is easy to ship. - H041: an html tag opened in one
{% block %}and closed in a different one. The pair looks balanced in the file, but a child template overriding either block renders unbalanced html. - H018 (off by default, enable with
--include=H018): void tags closed with/>instead of>, e.g.<br/>- the trailing slash has no effect in HTML. The opposite convention of the optional H017 ("void tags should be self closing"); enable one or the other, not both. - H042 (off by default, enable with
--include=H042): a<label for="...">whose value matches no elementidin the same file. Template-generated values are skipped; the rule is opt-in because inputs rendered by e.g.{{ form.email }}carry ids the linter cannot see.
Configuration:
indentandmax_line_lengthnow fall back toindent_sizeandmax_line_lengthfrom a.editorconfigat the project root. The command line and djlint config files still take precedence, and only sections applying to html (or the configuredextension) are read.
Documentation:
- Every linter rule now has a detailed entry on the linter page - what it checks, why it matters, and a verified Don't/Do example pair - in English, French, Russian and Chinese. Askama, Tera and Liquid get language pages, logos and homepage cards, and engines covered by existing profiles (MiniJinja, Jinjava, Pebble, the Liquid dialects) are noted on the pages of the profiles that cover them.
Fix
- H017 no longer misfires on tags that merely start with a void tag name:
<cola>(matched by a brokencolgroupexclusion) and custom elements like<img-icon>are no longer reported.<meta>tags, missing from the rule's void tag list, are now reported.