Skip to content

vue/padding-line-between-tags Support singleline/multiline options #1974

Open
@Ky6uk

Description

@Ky6uk

What rule do you want to change?

vue/padding-line-between-tags

Does this change cause the rule to produce more or fewer warnings?

More warnings.

How will the change be implemented? (New option, new default behavior, etc.)?

It could be an additional option like singleline/multiline.

{ "blankLine": "always", "prev": "div-singleline", "next": "span-multiline" }

But it might be a bad example as <div-singleline /> might be the correct tag/component. So it could be also:

{ "blankLine": "always", "prevMulti": "div", "nextSingle": "span" }

Please provide some example code that this change will affect:

<div>
  This is a multiline tag
<div>
<span>This is a singleline tag</span>

Will trigger an error with configuration like that:

{ "blankLine": "always", "prevMulti": "div", "nextSingle": "span" }

Moreover, it will be possible to force the required padding line between multiline and singleline tags in general.

For the ruleset like this:

[
  { "blankLine": "always", "prevMulti":  "*", "nextSingle": "*" },
  { "blankLine": "always", "prevSingle": "*", "nextMulti":  "*" },
  { "blankLine": "always", "prevMulti":  "*", "nextMulti":  "*" },
  { "blankLine": "never",  "prevSingle": "*", "nextSingle": "*" }
]

It will be possible to have code like this:

<div>
  This is a multiline tag
<div>

<div>
  This is a multiline tag
<div>

<div>
  This is a multiline tag
<div>

<span>This is a singleline tag</span>
<span>This is a singleline tag</span>

<div>
  This is a multiline tag
<div>

<span>This is a singleline tag</span>

<div>
  This is a multiline tag
<div>

<span>This is a singleline tag</span>
<span>This is a singleline tag</span>
<span>This is a singleline tag</span>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions