Skip to content
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

Update default settings in html-closing-bracket-newline #539

Merged
merged 1 commit into from
Jul 30, 2018

Conversation

michalsnik
Copy link
Member

@michalsnik michalsnik commented Jul 26, 2018

This PR introduces update to default setting for html-closing-bracket-newline, to force new line in case of multiline elements.

{
  "singleline": "never",
  "multiline": "always"
}

The reason behind this update, is that in case of multiline elements, having closing tag on a separate line makes the code more readable. Especially when there are many elements in the template. We could compare it to JS objects. We don't write:

const a = {
  key: 'value' };

but rather:

const a = {
  key: 'value'
};

Incorrect code regarding new setting:

<SomeComponent
  class="lorem"
  :lorem="ipsum" />

Correct code:

<SomeComponent
  class="lorem"
  :lorem="ipsum"
/>

singleline setting stays as is, forcing devs to keep closing tag at the same line.

@michalsnik michalsnik self-assigned this Jul 26, 2018
@michalsnik michalsnik requested a review from chrisvfritz July 26, 2018 22:49
@michalsnik michalsnik merged commit 6a117c2 into master Jul 30, 2018
@michalsnik michalsnik deleted the update-default-in-html-closing-bracket-newline branch July 30, 2018 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants