diff --git a/.changeset/strong-masks-fetch.md b/.changeset/strong-masks-fetch.md new file mode 100644 index 000000000..b7b3b22a0 --- /dev/null +++ b/.changeset/strong-masks-fetch.md @@ -0,0 +1,5 @@ +--- +'eslint-plugin-vue': patch +--- + +Fixed inconsistent quotes in [`vue/block-lang`](https://eslint.vuejs.org/rules/block-lang.html) error messages diff --git a/lib/rules/block-lang.js b/lib/rules/block-lang.js index 2190b17cb..8fccd29f9 100644 --- a/lib/rules/block-lang.js +++ b/lib/rules/block-lang.js @@ -40,7 +40,7 @@ const DEFAULT_LANGUAGES = { * @param {NonNullable} lang */ function getAllowsLangPhrase(lang) { - const langs = [...lang].map((s) => `"${s}"`) + const langs = [...lang].map((s) => `'${s}'`) switch (langs.length) { case 1: { return langs[0] @@ -157,7 +157,7 @@ module.exports = { missing: "The 'lang' attribute of '<{{tag}}>' is missing.", unexpected: "Do not specify the 'lang' attribute of '<{{tag}}>'.", useOrNot: - "Only {{allows}} can be used for the 'lang' attribute of '<{{tag}}>'. Or, not specifying the `lang` attribute is allowed.", + "Only {{allows}} can be used for the 'lang' attribute of '<{{tag}}>'. Or, not specifying the 'lang' attribute is allowed.", unexpectedDefault: "Do not explicitly specify the default language for the 'lang' attribute of '<{{tag}}>'." } diff --git a/tests/lib/rules/block-lang.js b/tests/lib/rules/block-lang.js index ad1b9842c..af8b837d6 100644 --- a/tests/lib/rules/block-lang.js +++ b/tests/lib/rules/block-lang.js @@ -42,7 +42,8 @@ tester.run('block-lang', rule, { options: [{ script: { lang: 'ts' } }], errors: [ { - message: `Only "ts" can be used for the 'lang' attribute of '