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

Ignore HTML comments in vue/multiline-html-element-content-newline #2179

Open
dsl101 opened this issue May 17, 2023 · 0 comments · May be fixed by #2581
Open

Ignore HTML comments in vue/multiline-html-element-content-newline #2179

dsl101 opened this issue May 17, 2023 · 0 comments · May be fixed by #2581

Comments

@dsl101
Copy link
Contributor

dsl101 commented May 17, 2023

What rule do you want to change?
vue/multiline-html-element-content-newline

Does this change cause the rule to produce more or fewer warnings?
Fewer if new option set

How will the change be implemented? (New option, new default behavior, etc.)?
New option, or extension to the ignores option. Either a boolean option, default false, called something like allowHTMLComments, or a token such as HTMLComments added to the list of possible ignores values. Note I'm not sure about the latter, as my understanding is that ignores list is looking for the element names before the subsequent content without newline (e.g. the <div>), where as we'd like to allow multiline for any element, providing that the subsequent element is a comment.

Please provide some example code that this change will affect:
To enable this to be Good:

<div class="something">  <!-- or use class="other" -->
  <Component />
</div>

What does the rule currently do for this code?
Currently, it produces the error vue/multiline-html-element-content-newline – Expected 1 line break after opening tab ('<div>'), but no line breaks found.

What will the rule do after it's changed?
Produce no errors / warnings with same-line HTML comments

Additional context
This is a common pattern for our JS code, and we'd like to be able to use the same kind of inline comments within the template:

const meaning = 42  // obviously
@dsl101 dsl101 changed the title vue/multiline-html-element-content-newline option to ignore comments Rule Proposal: vue/multiline-html-element-content-newline May 17, 2023
@FloEdelmann FloEdelmann changed the title Rule Proposal: vue/multiline-html-element-content-newline Ignore HTML comments in vue/multiline-html-element-content-newline May 17, 2023
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 a pull request may close this issue.

1 participant