rule-proposal: add a new line after html-closing-bracket
See original GitHub issueWhat category of rule is this? (place an “X” next to just one item)
[X] Enforces code style [ ] Warns about a potential error [ ] Suggests an alternate way of doing something
It could be a very convenient with the html-closing-bracket-newline
rule usage.
Motivation:
Currently, this piece of html a fully valid when used with vue/recommended and this rule:
"vue/html-closing-bracket-newline": ["error", {
"singleline": "never",
"multiline": "always"
}],
They are all different:
<li>
<a
href="http://router.vuejs.org/"
target="_blank"
>vue-router</a>
</li>
<li>
<a
href="http://vuex.vuejs.org/"
target="_blank"
>
vuex
</a>
</li>
<li>
<a
href="http://vue-loader.vuejs.org/"
target="_blank"
>vue-loader
</a>
</li>
Suggestion
With suggested rule it could looks like the following:
<li>
<a
href="http://router.vuejs.org/"
target="_blank"
>
vue-router
</a>
</li>
<div>
<div
some="prop"
another="prop"
>
<some-html>
<even-more />
</some-html>
</div>
</li>
But If there is no children I suggest no newline.
<div>
<div some="prop"
another="prop"
></div>
</li>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:5 (3 by maintainers)
Top Results From Across the Web
vue/html-closing-bracket-newline
People have their own preference about the location of closing brackets. This rule enforces a line break (or no line break) before tag's ......
Read more >block-closing-brace-newline-after - Stylelint
The newline after this brace */. This rule allows an end-of-line comment separated from the closing brace by spaces, as long as the...
Read more >Prettier 2.6: new singleAttributePerLine option and new ...
This release includes a new singleAttributePerLine option. This is an option to print only one attribute per line in Vue SFC templates, HTML...
Read more >Auto-completion - Notepad++ User Manual
Notepad++ offers automatic completion of various sorts of text after you have ... caret is between the opening and closing parentheses of the...
Read more >Airbnb JavaScript Style Guide()
4.7 Use line breaks after open and before close array brackets if an array ... You can add new properties over time or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I see it like this:
Settings:
Incorrect:
Correct:
Settings:
Incorrect:
Correct:
singleline
andmultiline
options describe range of opening tag.I am trying to get rid of those standalone and trailing
>
. Any option to adjust?