From 6d296a25e16df31e6225eceb753bcd8e2b63fe6a Mon Sep 17 00:00:00 2001 From: waynzh Date: Tue, 15 Apr 2025 19:55:12 +0800 Subject: [PATCH] feat(prefer-template): ignore style block --- lib/rules/prefer-template.js | 4 +--- tests/lib/rules/prefer-template.js | 31 +++++++++--------------------- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/lib/rules/prefer-template.js b/lib/rules/prefer-template.js index c622a4fad..73e17391f 100644 --- a/lib/rules/prefer-template.js +++ b/lib/rules/prefer-template.js @@ -6,6 +6,4 @@ const { wrapCoreRule } = require('../utils') // eslint-disable-next-line internal/no-invalid-meta -module.exports = wrapCoreRule('prefer-template', { - applyDocument: true -}) +module.exports = wrapCoreRule('prefer-template') diff --git a/tests/lib/rules/prefer-template.js b/tests/lib/rules/prefer-template.js index 0c4b3366b..5ef90f3c4 100644 --- a/tests/lib/rules/prefer-template.js +++ b/tests/lib/rules/prefer-template.js @@ -28,7 +28,15 @@ tester.run('prefer-template', rule, { .text { color: v-bind('\`#\${hex}\`') } - ` + `, + // https://github.com/vuejs/eslint-plugin-vue/issues/2712 + ` + + ` ], invalid: [ { @@ -64,27 +72,6 @@ tester.run('prefer-template', rule, { line: 3 } ] - }, - // CSS vars injection - { - code: ` - `, - output: ` - `, - errors: [ - { - message: 'Unexpected string concatenation.', - line: 4 - } - ] } ] })