yeonjuan / html-eslint

ESLint plugin for linting HTML
https://html-eslint.org
MIT License
155 stars 28 forks source link

[Bug] `element-newline` incorrectly reports on siblings #210

Closed RobertAKARobin closed 2 weeks ago

RobertAKARobin commented 1 month ago

For example, this test fails. It should pass because b and c are skipped:

    {
      code: `<a>
<b></b><c></c>
</a>`,
      options: [
        {
          skip: ["b", "c"]
        }
      ]
    }
RobertAKARobin commented 1 month ago

Actually this seems to be a bug with checking sibling elements in general. Updated the main post.

yeonjuan commented 1 month ago

Hi @RobertAKARobin

This rule has an object option: "skip": skips newline checking for the specified element's children

This seems not a bug. The skip option skips checking children's newlines of the specified tag.

RobertAKARobin commented 3 weeks ago

This additional functionality added in https://github.com/yeonjuan/html-eslint/pull/214