From 5b0ae66a2e6493a7e03233ee034c16f60bd1fcf7 Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Thu, 22 Jun 2023 13:30:13 +0200 Subject: [PATCH] Ignore blocks in `vue/html-self-closing` --- lib/rules/html-self-closing.js | 2 +- tests/lib/rules/html-self-closing.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/rules/html-self-closing.js b/lib/rules/html-self-closing.js index 19fc4b587..6cbbb7a6d 100644 --- a/lib/rules/html-self-closing.js +++ b/lib/rules/html-self-closing.js @@ -131,7 +131,7 @@ module.exports = { context, { VElement(node) { - if (hasInvalidEOF) { + if (hasInvalidEOF || node.parent.type === 'VDocumentFragment') { return } diff --git a/tests/lib/rules/html-self-closing.js b/tests/lib/rules/html-self-closing.js index c600fdaf1..5589c3da1 100644 --- a/tests/lib/rules/html-self-closing.js +++ b/tests/lib/rules/html-self-closing.js @@ -64,6 +64,9 @@ tester.run('html-self-closing', rule, { '