eslint-plugin-vue icon indicating copy to clipboard operation
eslint-plugin-vue copied to clipboard

Add option to separately control self-closing tag's closing-bracket newline

Open pycodev opened this issue 5 years ago • 1 comments

Please describe what the rule should do:

hope to Add particular option on the rule, vue/html-closing-bracket-newline , to control self-closing tag's closing-bracket newline.

What category should the rule belong to?

  • [x] Enforces code style
  • [ ] Warns about a potential error
  • [ ] Suggests an alternate way of doing something
  • [ ] Other (please specify:)

Provide 2-3 code examples that this rule should warn about:

so that we can respectively control the un-self-closing tag and self-closing tag's closing-bracket style. like below

<!-- 
the rule may like this: 
{
  "vue/html-closing-bracket-newline": ["error", {
    "singleline": "never",
    "multiline": {
        "unselfclose": "never",
        "selfclose": "always"
    },
  }]
}
 -->
<component attr1="value1" attr2="value2"></component>

<component attr1="value1" attr2="value2" />

<component
    attr1="value1"
    attr2="value2">
    content
</component>

<component
    attr1="value1"
    attr2="value2"
/>

THX :)

pycodev avatar Nov 20 '19 13:11 pycodev

I'm also looking for something similar 👍

imlinus avatar Mar 23 '20 13:03 imlinus