-
-
Notifications
You must be signed in to change notification settings - Fork 681
Rule Proposal vue/closing-bracket-location
#169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There is some discussion regarding this in #46 (comment) and I believe there is already some wip in #145 |
Thank you for this proposal. Yes, My proposal is: {
"vue/html-closing-bracket-newline": ["error", {
"singleline": "never" | "always",
"multiline": "never" | "always"
}]
}
Examples: /* eslint vue/html-closing-bracket-newline: error */
// VALID:
<div>
<div id="" class=""/>
<div id="" class="" />
<div
id=""
class="" />
// INVALID
<div
>
<div id="" class=""
/>
<div
id=""
class=""
/>
<div
id=""
class=""
/> /* eslint vue/html-closing-bracket-newline: [error, { multiline: always }] */
// VALID:
<div>
<div id="" class=""/>
<div id="" class="" />
<div
id=""
class=""
/>
<div
id=""
class=""
/>
// INVALID
<div
>
<div id="" class=""
/>
<div
id=""
class=""/>
<div
id=""
class="" /> |
I like both proposals, but in your example @mysticatea if the |
At first, I apologize that I'm inactive while a long time. @michalsnik It's the same thing for all core rules about line-breaks such as array-bracket-newline. In core rules, the rule which auto-fixes line-breaks does not consider indentation and line-break character type ( |
Please describe what the rule should do:
Provide a template rule similar to
react/jsx-closing-bracket-location
for vue templates.This rule would govern the indentation style for the closing bracket of html tags within vue components when a tag spans multiple lines. (single-line tags are fine)
What 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
[ ] Other (please specify:)
Provide 2-3 code examples that this rule will warn about:
Configuration
'vue/closing-bracket-location': ['tag-aligned' | 'line-aligned' | 'after-props' | 'props-aligned']
Examples:
The following would not produce errors:
The text was updated successfully, but these errors were encountered: