Skip to content

[BUG] [Linter] Djlint marks href="/" as D018 error #1601

@maddrum

Description

@maddrum

System Info

  • OS: e.g. ubuntu 24.04
  • Python Version 3.12
  • djLint Version 1.36.4
  • template language: Djnago

Issue

Linter is producing a false-positive error D018 when checking links like:

<a href="/">Home</a>

Home links should be excluded from those errors, since you might be using CMS pages, or the home page could not be a part of your project at all.

How To Reproduce

Create a template that have <a href="/">Home</a>

Run djlint on that template.

Contents of djlint.toml/.djlintrc/pyproject.toml [tool.djlint]

[tool.djlint]
profile = "django"
indent = 4
extend_exclude = 'venv,.venv,node_modules,migrations,static,docs,browser_tests,.local'
use_gitignore = true
blank_line_after_tag = "load,extends,include"
ignore = 'T002,T032,H006,H014,H021'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions