From c68cb1a49f6dcaede556490b391631aac4940cca Mon Sep 17 00:00:00 2001 From: Wayne Zhang Date: Tue, 29 Apr 2025 09:08:31 +0800 Subject: [PATCH 1/4] feat(no-bare-strings-in-template): `allowlist` support regex (#2734) Co-authored-by: Flo Edelmann --- docs/rules/no-bare-strings-in-template.md | 6 +- lib/rules/no-bare-strings-in-template.js | 48 ++++++++++++--- .../lib/rules/no-bare-strings-in-template.js | 60 +++++++++++++++++++ 3 files changed, 102 insertions(+), 12 deletions(-) diff --git a/docs/rules/no-bare-strings-in-template.md b/docs/rules/no-bare-strings-in-template.md index df1fae123..23a23c116 100644 --- a/docs/rules/no-bare-strings-in-template.md +++ b/docs/rules/no-bare-strings-in-template.md @@ -12,7 +12,7 @@ since: v7.0.0 ## :book: Rule Details -This rule disallows the use of bare strings in ` ` + }, + { + filename: 'test.vue', + code: ` + + `, + options: [{ disallowComments: false }] + }, + { + filename: 'test.vue', + code: ` + + `, + options: [{ disallowComments: false }] + }, + { + filename: 'test.vue', + code: ` + + `, + options: [{ disallowComments: true }] + }, + { + filename: 'test.vue', + code: ` + + `, + options: [{ disallowComments: true }] } ], invalid: [ @@ -104,6 +164,132 @@ ruleTester.run('no-multiple-template-root', rule, { filename: 'test.vue', code: '', errors: ["The template root disallows '