Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(block-lang): use consistent quotation marks in error messages#2805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions.changeset/strong-masks-fetch.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -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
4 changes: 2 additions & 2 deletionslib/rules/block-lang.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,7 +40,7 @@ const DEFAULT_LANGUAGES = {
*@param {NonNullable<BlockOptions['lang']>} lang
*/
functiongetAllowsLangPhrase(lang){
constlangs=[...lang].map((s)=>`"${s}"`)
constlangs=[...lang].map((s)=>`'${s}'`)
switch(langs.length){
case1:{
returnlangs[0]
Expand DownExpand Up@@ -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}}>'."
}
Expand Down
13 changes: 8 additions & 5 deletionstests/lib/rules/block-lang.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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 '<script>'.`,
message:
"Only 'ts' can be used for the 'lang' attribute of '<script>'.",
line: 2,
column: 15,
endLine: 2,
Expand All@@ -56,7 +57,8 @@ tester.run('block-lang', rule, {
options: [{ script: { lang: ['ts'] } }],
errors: [
{
message: `Only "ts" can be used for the 'lang' attribute of '<script>'.`,
message:
"Only 'ts' can be used for the 'lang' attribute of '<script>'.",
line: 2,
column: 15,
endLine: 2,
Expand DownExpand Up@@ -84,7 +86,8 @@ tester.run('block-lang', rule, {
options: [{ script: { lang: 'ts' } }],
errors: [
{
message: `Only "ts" can be used for the 'lang' attribute of '<script>'.`,
message:
"Only 'ts' can be used for the 'lang' attribute of '<script>'.",
line: 2,
column: 15,
endLine: 2,
Expand DownExpand Up@@ -153,7 +156,7 @@ tester.run('block-lang', rule, {
errors: [
{
message:
"Only\"json\" can be used for the 'lang' attribute of '<i18n>'. Or, not specifying the`lang` attribute is allowed.",
"Only'json' can be used for the 'lang' attribute of '<i18n>'. Or, not specifying the'lang' attribute is allowed.",
line: 2,
column: 13,
endLine: 2,
Expand All@@ -168,7 +171,7 @@ tester.run('block-lang', rule, {
errors: [
{
message:
'Only"json", and"yaml" can be used for the\'lang\' attribute of\'<i18n>\'. Or, not specifying the`lang` attribute is allowed.',
"Only'json', and'yaml' can be used for the 'lang' attribute of '<i18n>'. Or, not specifying the'lang' attribute is allowed.",
line: 2,
column: 13,
endLine: 2,
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp