MCPcopy Index your code
hub / github.com/djlint/djlint-vscode

github.com/djlint/djlint-vscode @v2026.7.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2026.7.0 ↗ · + Follow
55 symbols 94 edges 10 files 0 documented · 0% updated 1d agov2026.7.0 · 2026-07-01★ 752 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

djlint-vscode

CI Visual Studio Marketplace Installs Open VSX Downloads

Visual Studio Code extension for formatting and linting HTML templates (Django, Jinja, Nunjucks, Twig, Handlebars, Mustache) using djLint.

Installation

  1. Install djLint itself by following the djLint getting started guide or the djLint README.
  2. Install djLint VS Code extension from Visual Studio Marketplace or Open VSX.

Usage

If djlint.useVenv is enabled and you have the Python extension installed, djlint-vscode uses the djLint installed in the currently activated Python environment.

If djlint.useVenv is disabled, the extension runs djlint.executablePath (djlint from PATH by default). Relative djlint.executablePath and djlint.pythonPath values are resolved from the workspace root. If that executable is not available, it falls back to djlint.pythonPath -m djlint.

The extension can be configured through the settings in VS Code. Some options can be configured through the djLint configuration file.

Add this to your settings.json to format the default enabled languages with djLint:

"[html][django-html][handlebars][hbs][mustache][jinja][jinja-html][nj][njk][nunjucks][twig]": {
  "editor.defaultFormatter": "monosans.djlint"
}

Usage with djLint installed with pipx

pipx creates a separate venv for each application and usually exposes a djlint executable. Disable djlint.useVenv and point djlint.executablePath at that executable if it is not already available on PATH:

"djlint.useVenv": false,
"djlint.executablePath": "/home/user/.local/bin/djlint",

Usage with djLint installed with uv

uv creates a separate venv for each application. Disable djlint.useVenv and point djlint.executablePath at the generated djlint executable:

"djlint.useVenv": false,
"djlint.executablePath": "/home/user/.local/share/uv/tools/djlint/bin/djlint",

Known issues

  • Non-ASCII characters turn into ? on Windows after formatting. To fix this, update djLint to v1.1.1 or higher.

  • Linting does not work on Windows if the file contains non-ASCII characters. To fix this, update djLint to v1.1.1 or higher.

  • File contents are duplicated after formatting. This is a bug in djLint v1.12.1, install another version.

  • The config file is ignored on some versions of Python if it is in the root of the project. To fix this, update djLint to v1.19.2 or higher.

License

MIT

Extension points exported contracts — how you extend this code

RunnerCommand (Interface)
(no doc)
src/runner.ts
RunnerCommands (Interface)
(no doc)
src/runner.ts
ChildOptions (Interface)
(no doc)
src/runner.ts

Core symbols most depended-on inside this repo

resolveConfiguredExecutablePath
called by 4
src/runner.ts
getConfig
called by 3
src/config.ts
showError
called by 3
src/errors.ts
isCustomExecaError
called by 3
src/runner.ts
#register
called by 2
src/formatter.ts
#lint
called by 2
src/linter.ts
errorToOutputChannel
called by 2
src/errors.ts
checkErrors
called by 2
src/errors.ts

Shape

Method 20
Class 19
Function 13
Interface 3

Languages

TypeScript100%

Modules by API surface

src/args.ts26 symbols
src/runner.ts10 symbols
src/linter.ts7 symbols
src/formatter.ts7 symbols
src/errors.ts3 symbols
src/extension.ts1 symbols
src/config.ts1 symbols

For agents

$ claude mcp add djlint-vscode \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page