From 662c003a61388fb3444c80a1ac00233d56c3dd9d Mon Sep 17 00:00:00 2001 From: Armano Date: Thu, 24 Aug 2017 19:08:55 +0200 Subject: [PATCH] Fix incorrectly flags rule valid-template-root for pug fixes #165 --- lib/rules/valid-template-root.js | 5 +++++ tests/lib/rules/valid-template-root.js | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/lib/rules/valid-template-root.js b/lib/rules/valid-template-root.js index 2f511d31e..7984443a7 100644 --- a/lib/rules/valid-template-root.js +++ b/lib/rules/valid-template-root.js @@ -31,6 +31,11 @@ function create (context) { return } + const lang = utils.getAttribute(element, 'lang') + if (lang && lang.value.value !== 'html') { + return // Ignore pug and .... + } + const hasSrc = utils.hasAttribute(element, 'src') const rootElements = [] let extraText = null diff --git a/tests/lib/rules/valid-template-root.js b/tests/lib/rules/valid-template-root.js index 0aef8cbc5..e5676ccb3 100644 --- a/tests/lib/rules/valid-template-root.js +++ b/tests/lib/rules/valid-template-root.js @@ -31,6 +31,10 @@ tester.run('valid-template-root', rule, { filename: 'test.vue', code: '' }, + { + filename: 'test.vue', + code: '' + }, { filename: 'test.vue', code: ''