Skip to content

[BUG] indent with tagChildrenIndent rule doesn’t work on unwrapped text #406

@mfehrenbach

Description

@mfehrenbach

Somewhat edge-casey: the indent rule’s very-snazzy tagChildrenIndent rule does not seem to work on unwrapped/loose text “nodes.”

With this kind of config:

{
  "@html-eslint/indent": [
    "error",
    "tab",
    {
      "tagChildrenIndent": {
        "div": 0,
      }
    }
  ]
}

And this input:

<div>
Some loose text (maybe… _Markdown_ 🙃).
</div>

It’ll ignore that 0 and diligently output one indentation level more:

<div>
	Some loose text (maybe… _Markdown_ 🙃).
</div>

I’d expect the indent option to be honored regardless of whether the child is an element or not.

(Yes, I might be trying to lint mixed Markdown/HTML, as one does. But I can imagine other stylistic scenarios!)

Thanks again. ✊

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions