Twig 模板代码检查与格式化工具
djLint 可以检查和格式化 Twig 模板。设置 nunjucks 预设,让规则和格式化方式适合这类模板。
Pebble(Java)模板与 Twig 兼容,因此也请为它们使用这个预设。
djlint /path/to/templates --profile=nunjucks在配置文件中
Section titled “在配置文件中”在项目的 pyproject.toml、djlint.toml / .djlint.toml 或 .djlintrc 文件中配置 djLint。
[tool.djlint]profile = "nunjucks"profile = "nunjucks"{ "profile": "nunjucks" }