Skip to content

feat: add ignoreComments option to content newline rules - #3228

Open
ValentinYoushkevich wants to merge 4 commits into
vuejs:masterfrom
ValentinYoushkevich:feat/content-newline-ignore-comments
Open

ValentinYoushkevich wants to merge 4 commits into
vuejs:masterfrom
ValentinYoushkevich:feat/content-newline-ignore-comments

Conversation

@ValentinYoushkevich

Copy link
Copy Markdown
Contributor

This continues #2581 by dsl101. It adds an ignoreComments option (default false) to vue/multiline-html-element-content-newline and, as Flo asked there, to vue/singleline-html-element-content-newline. With the option on, an HTML comment on the same line as the opening tag, or right before the closing tag, is no longer treated as content, so the line break is checked against the content after or before it. #2581 dropped comments from the token list entirely, which broke the case Flo found: a comment on its own line before an element made the parent report two line breaks. Here comments are only skipped next to the tags, so own-line comments count as before. Autofix never moves or removes a comment.

Closes #2179

@changeset-bot

changeset-bot Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 51e27bf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-plugin-vue Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@FloEdelmann FloEdelmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@FloEdelmann
FloEdelmann requested a review from a team October 29, 2026 09:20
@@ -0,0 +1,5 @@
---
"eslint-plugin-vue": minor

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's wait before merging this to have a bugfix-only release first.

This branch has not been deployed

No deployments
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.

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

3 participants