Skip to content

Commit

Permalink
Ignore blocks in vue/html-self-closing (#2223)
Browse files Browse the repository at this point in the history
  • Loading branch information
FloEdelmann authored Jul 2, 2023
1 parent d1f1eea commit cd32f03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/html-self-closing.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ module.exports = {
context,
{
VElement(node) {
if (hasInvalidEOF) {
if (hasInvalidEOF || node.parent.type === 'VDocumentFragment') {
return
}

Expand Down
3 changes: 3 additions & 0 deletions tests/lib/rules/html-self-closing.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ tester.run('html-self-closing', rule, {
'<template><div a=">test</div></template>',
'<template><div><!--test</div></template>',

// Empty top-level tags
'<template></template><script></script><docs></docs>',

// https://github.com/vuejs/eslint-plugin-vue/issues/1403
{
code: `
Expand Down

0 comments on commit cd32f03

Please sign in to comment.