{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://djlint.com/schema/djlint.json",
  "$comment": "Source: https://github.com/djlint/djLint/blob/master/docs/src/static/schema/djlint.json",
  "title": "djLint configuration",
  "description": "Configuration for djLint, an HTML template linter and formatter. https://djlint.com/docs/configuration/",
  "type": "object",
  "additionalProperties": false,
  "definitions": {
    "css-beautify": { "type": "object" },
    "js-beautify": { "type": "object" }
  },
  "properties": {
    "$schema": {
      "description": "The url of the schema this file is checked against.",
      "type": "string"
    },
    "allow_empty_input": {
      "description": "Exit with 0 instead of 2 when the given paths match no files at all. Files that were found and then skipped by exclude, extend_exclude, use_gitignore or require_pragma already exit with 0. Disabled by default.",
      "type": "boolean"
    },
    "blank_line_after_tag": {
      "description": "Add an additional blank line after `{% <tag> ... %}` tag groups. Blank lines will never be added to end of block.",
      "type": "string"
    },
    "blank_line_before_tag": {
      "description": "Add an additional blank line before `{% <tag> ... %}` tag groups. Blank lines will never be added to start of file or block, or between similar tags.",
      "type": "string"
    },
    "close_void_tags": {
      "description": "Add a closing mark to known void tags, so that `<img>` becomes `<img />`.",
      "type": "boolean"
    },
    "css": {
      "description": "Options passed to cssbeautifier when --format-css is on, such as indent_size.",
      "$ref": "#/definitions/css-beautify"
    },
    "custom_blocks": {
      "description": "Use to indent custom code blocks. For example `{% toc %}...{% endtoc %}`.",
      "type": "string"
    },
    "custom_html": {
      "description": "Use to indent custom HTML tags. For example `<mjml>` or `<simple-greeting>` or `<mj-\\\\w+>`",
      "type": "string"
    },
    "exclude": {
      "description": "Override the default exclude paths.",
      "type": "string"
    },
    "extend_exclude": {
      "description": "Add additional paths to the default exclude.",
      "type": "string"
    },
    "extension": {
      "description": "Use to only find files with a specific extension.",
      "type": "string"
    },
    "files": {
      "description": "A list of paths to use as djlint's source. When this option is specified, the command line source must be `-` as if using stdin.",
      "type": "array",
      "items": { "type": "string" }
    },
    "format_attribute_js_json": {
      "description": "Format JavaScript and JSON code inside HTML attributes. This will format object literals and JavaScript code in attributes like `onclick`, `x-*`, and other JavaScript-related attributes. Objects with fewer properties than `format_attribute_js_json_min_props` will not be formatted.",
      "type": "boolean"
    },
    "format_attribute_js_json_min_props": {
      "description": "Minimum number of properties required in a JavaScript/JSON object for it to be formatted. Default is 2. Objects with fewer properties will remain on a single line.",
      "type": "integer",
      "minimum": 0
    },
    "format_attribute_js_json_pattern": {
      "description": "Custom regex pattern to match JavaScript attributes for formatting. Default pattern matches common JavaScript attributes like `onclick`, `x-*`, Vue.js directives, Alpine.js directives, Angular directives, and more.",
      "type": "string"
    },
    "format_attribute_template_tags": {
      "description": "Formatter will attempt to format template syntax inside of tag attributes. Disabled by default.",
      "type": "boolean"
    },
    "format_css": {
      "description": "Format contents of `style` tags using `css-beautify`. See [css-beautify](https://github.com/beautify-web/js-beautify/blob/main/python/cssbeautifier/css/options.py) for all configuration options. Template syntax is not [fully supported](https://github.com/beautify-web/js-beautify/issues).",
      "type": "boolean"
    },
    "format_js": {
      "description": "Format contents of `script` tags using `js-beautify`. See [js-beautify](https://github.com/beautify-web/js-beautify/blob/main/python/jsbeautifier/javascript/options.py) for all configuration options. Template syntax is not [fully supported](https://github.com/beautify-web/js-beautify/issues).",
      "type": "boolean"
    },
    "ignore": { "description": "Ignore linter codes.", "type": "string" },
    "ignore_blocks": {
      "description": "Used to skip indentation on children of template tags. Children will be treated as siblings and indented accordingly.",
      "type": "string"
    },
    "ignore_case": {
      "description": "Do not attempt to fix the case of known html tags.",
      "type": "boolean"
    },
    "include": { "description": "Include linter codes.", "type": "string" },
    "indent": {
      "description": "Use to change the code indentation. Default is 4 (four spaces).",
      "type": "integer",
      "minimum": 0
    },
    "js": {
      "description": "Options passed to jsbeautifier when --format-js is on, such as indent_size.",
      "$ref": "#/definitions/js-beautify"
    },
    "keep_br_inline": {
      "description": "Keep `<br>` on the line of the text it breaks, rather than giving it a line of its own. `<hr>`, which renders as a rule below the preceding content, is unaffected.",
      "type": "boolean"
    },
    "line_break_after_multiline_tag": {
      "description": "Do not condense the content of multi-line tags into the line of the last attribute.",
      "type": "boolean"
    },
    "linter_output_format": {
      "description": "Customize order of output message. Default=\"{code} {line} {message} {match}\". If `{filename}` is not included in message, then the output will be grouped by file and a header will automatically be added to each group.\n\nOptional variables:\n::: content\n\n- `{filename}`\n- `{line}`\n- `{code}`\n- `{message}`\n- `{match}`\n  :::",
      "type": "string",
      "examples": ["{filename}:{line}: {code} {message} {match}"]
    },
    "max_attribute_length": {
      "description": "Formatter will attempt to wrap tag attributes if the attribute length exceeds this value.",
      "type": "integer",
      "minimum": 0
    },
    "max_blank_lines": {
      "description": "Consolidate blank lines down to x lines. Default is 0 meaning blank lines will be removed.",
      "type": "integer",
      "minimum": 0
    },
    "max_line_length": {
      "description": "Formatter will attempt to put some html and template tags on a single line instead of wrapping them if the line length will not exceed this value.",
      "type": "integer",
      "minimum": 0
    },
    "name_endblocks": {
      "description": "Write the block's name into the `{% endblock %}` that closes it, where the block is written across lines. This is what `T003` asks for.",
      "type": "boolean"
    },
    "no_entity_formatting": {
      "description": "Do not rewrite an entity reference as the character it names, so `&copy;` is left as written rather than becoming `\u00a9`. The entities that carry syntax, and the invisible ones, are never rewritten either way.",
      "type": "boolean"
    },
    "no_function_formatting": {
      "description": "Do not attempt to format the arguments of function calls inside `{{ }}` expressions.",
      "type": "boolean"
    },
    "no_indent_inner_html": {
      "description": "Do not indent `<head>` and `<body>` below `<html>`, which is how the default VS Code html formatter lays a document out.",
      "type": "boolean"
    },
    "no_line_after_yaml": {
      "description": "Do not add a blank line after yaml front matter.",
      "type": "boolean"
    },
    "no_set_formatting": {
      "description": "Do not attempt to format the contents of `{% set %}` tags.",
      "type": "boolean"
    },
    "per-file-ignores": {
      "description": "Ignore linter rules on a per-file basis.",
      "type": "object",
      "additionalProperties": { "type": "string" }
    },
    "preserve_blank_lines": {
      "description": "Preserve blank lines where possible. Ideal for non-html template files where blank lines are intentional.",
      "type": "boolean"
    },
    "preserve_class_newlines": {
      "description": "Preserve line breaks inside multiline class attributes.",
      "type": "boolean"
    },
    "preserve_leading_space": {
      "description": "Preserve leading space on text, where possible. Ideal for non-html template files where text indent is intentional.",
      "type": "boolean"
    },
    "profile": {
      "description": "Set a profile for the template language. The profile will enable linter rules that apply to your template language, and may also change reformatting. For example, in `handlebars` there are no spaces inside `{{#if}}` tags.\n\nOptions:\n\n:::content\n\n- html (default)\n- django\n- jinja\n- nunjucks (for nunjucks and twig)\n- handlebars (for handlebars and mustache)\n- liquid (shopify, jekyll, eleventy)\n- golang (go templates; hugo, helm)\n- angular\n- tera (also for zola; use jinja for minijinja)\n- askama (jinja-style templates in rust; rust expressions are never reformatted)\n  :::",
      "enum": [
        "all",
        "angular",
        "askama",
        "django",
        "golang",
        "handlebars",
        "html",
        "jinja",
        "liquid",
        "nunjucks",
        "tera"
      ]
    },
    "quiet": {
      "description": "Do not print diff when reformatting.",
      "type": "boolean"
    },
    "quote_style": {
      "description": "Quotes to use for strings inside template tags, either `double` (the default) or `single`. `T002` requires the same quotes. The formatter uses them in a condition too, such as `{% if x == \"a\" %}`, so one file does not spell the same string both ways. HTML attribute quoting is left to `H008`.",
      "enum": ["double", "single"]
    },
    "require_pragma": {
      "description": "Only format or lint files that starts with a comment with only the text 'djlint:on'. The comment can be a HTML comment or a comment in the template language defined by the profile setting. If no profile is specified, a comment in any of the template languages is accepted.\n\n```html\n<!-- djlint:on -->\n{# djlint:on #}\n{% comment %} djlint:on {% endcomment %}\n{{ /* djlint:on */ }}\n{{!-- djlint:on --}}\n```\n",
      "type": "boolean"
    },
    "single_attribute_per_line": {
      "description": "When an opening tag wraps, put the tag name, each attribute, and the closing bracket on separate lines. Disabled by default.",
      "type": "boolean"
    },
    "sort_attributes": {
      "description": "Sort attributes by name, with `id` first and `class` second. A tag whose attributes are guarded by a template tag keeps the order it was written in, since moving one out of its branch would change the page.",
      "type": "boolean"
    },
    "use_gitignore": {
      "description": "Add .gitignore excludes to the default exclude. Disabled by default.",
      "type": "boolean"
    }
  }
}
