Skip to content

vue/padding-line-between-tags with new 'consistent' option #1978

Closed
@mesqueeb

Description

@mesqueeb

What rule do you want to change?
vue/padding-line-between-tags
https://eslint.vuejs.org/rules/padding-line-between-tags.html#vue-padding-line-between-tags

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

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

I don't want blank lines in between all siblings or after specific tags.

What I would love:

  • no blank lines between siblings: GOOD
  • blank lines between siblings: also GOOD
  • under the same parent blank lines between some siblings, but not others: BAD

Inconsistent spacing between same parent siblings is really inconsistent and drives me crazy. However, I do not want to force or disallow blank lines, I feel it's often a case-by-case choice depending how cluttered a parent with siblings looks.

My rule wish is:

{
  "vue/padding-line-between-tags": ["error", [
    { "blankLine": "consistent", "prev": "*", "next": "*" }
  ]]
}

Please provide some example code that this change will affect:

GOOD

<template>
  <header>
    <div></div>
    <div></div>
    <div></div>
  </header>

  <div></div>
  
  <div />
  
  <footer></footer>
</template>

GOOD

<template>
  <header>
    <div></div>

    <div></div>
    
    <div></div>
  </header>
  <div></div>
  <div />
  <footer></footer>
</template>

BAD

<template>
  <header>
    <div></div>

    <div></div>
    <div></div>
  </header>
  <div></div>

  <div />
  <footer></footer>
</template>

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