Skip to content

Twig template linter and formatter

djLint lints and formats Twig templates. Set the nunjucks profile so the rules and the formatting fit them.

What is Twig?

Pebble (Java) templates are Twig-compatible, so use this same profile for them.

Terminal window
djlint /path/to/templates --profile=nunjucks

Configure djLint in your project’s pyproject.toml, djlint.toml / .djlint.toml, or .djlintrc file.

pyproject.toml
[tool.djlint]
profile = "nunjucks"
djlint.toml / .djlint.toml
profile = "nunjucks"
.djlintrc
{ "profile": "nunjucks" }