Skip to content

Commit e0a9c92

Browse files
authored
Merge branch 'master' into test/strict/block-spacing
2 parents afaec97 + effb84a commit e0a9c92

File tree

4 files changed

+88
-26
lines changed

4 files changed

+88
-26
lines changed

.changeset/strong-masks-fetch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'eslint-plugin-vue': patch
3+
---
4+
5+
Fixed inconsistent quotes in [`vue/block-lang`](https://eslint.vuejs.org/rules/block-lang.html) error messages

lib/rules/block-lang.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const DEFAULT_LANGUAGES = {
4040
* @param {NonNullable<BlockOptions['lang']>} lang
4141
*/
4242
function getAllowsLangPhrase(lang) {
43-
const langs = [...lang].map((s) => `"${s}"`)
43+
const langs = [...lang].map((s) => `'${s}'`)
4444
switch (langs.length) {
4545
case 1: {
4646
return langs[0]
@@ -157,7 +157,7 @@ module.exports = {
157157
missing: "The 'lang' attribute of '<{{tag}}>' is missing.",
158158
unexpected: "Do not specify the 'lang' attribute of '<{{tag}}>'.",
159159
useOrNot:
160-
"Only {{allows}} can be used for the 'lang' attribute of '<{{tag}}>'. Or, not specifying the `lang` attribute is allowed.",
160+
"Only {{allows}} can be used for the 'lang' attribute of '<{{tag}}>'. Or, not specifying the 'lang' attribute is allowed.",
161161
unexpectedDefault:
162162
"Do not explicitly specify the default language for the 'lang' attribute of '<{{tag}}>'."
163163
}

tests/lib/rules/block-lang.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ tester.run('block-lang', rule, {
4242
options: [{ script: { lang: 'ts' } }],
4343
errors: [
4444
{
45-
message: `Only "ts" can be used for the 'lang' attribute of '<script>'.`,
45+
message:
46+
"Only 'ts' can be used for the 'lang' attribute of '<script>'.",
4647
line: 2,
4748
column: 15,
4849
endLine: 2,
@@ -56,7 +57,8 @@ tester.run('block-lang', rule, {
5657
options: [{ script: { lang: ['ts'] } }],
5758
errors: [
5859
{
59-
message: `Only "ts" can be used for the 'lang' attribute of '<script>'.`,
60+
message:
61+
"Only 'ts' can be used for the 'lang' attribute of '<script>'.",
6062
line: 2,
6163
column: 15,
6264
endLine: 2,
@@ -84,7 +86,8 @@ tester.run('block-lang', rule, {
8486
options: [{ script: { lang: 'ts' } }],
8587
errors: [
8688
{
87-
message: `Only "ts" can be used for the 'lang' attribute of '<script>'.`,
89+
message:
90+
"Only 'ts' can be used for the 'lang' attribute of '<script>'.",
8891
line: 2,
8992
column: 15,
9093
endLine: 2,
@@ -153,7 +156,7 @@ tester.run('block-lang', rule, {
153156
errors: [
154157
{
155158
message:
156-
"Only \"json\" can be used for the 'lang' attribute of '<i18n>'. Or, not specifying the `lang` attribute is allowed.",
159+
"Only 'json' can be used for the 'lang' attribute of '<i18n>'. Or, not specifying the 'lang' attribute is allowed.",
157160
line: 2,
158161
column: 13,
159162
endLine: 2,
@@ -168,7 +171,7 @@ tester.run('block-lang', rule, {
168171
errors: [
169172
{
170173
message:
171-
'Only "json", and "yaml" can be used for the \'lang\' attribute of \'<i18n>\'. Or, not specifying the `lang` attribute is allowed.',
174+
"Only 'json', and 'yaml' can be used for the 'lang' attribute of '<i18n>'. Or, not specifying the 'lang' attribute is allowed.",
172175
line: 2,
173176
column: 13,
174177
endLine: 2,

tests/lib/rules/block-order.js

Lines changed: 73 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,16 @@ tester.run('block-order', rule, {
203203
{
204204
message: "'<template>' should be above '<style>' on line 1.",
205205
line: 1,
206-
column: 16
206+
column: 16,
207+
endLine: 1,
208+
endColumn: 37
207209
},
208210
{
209211
message: "'<script>' should be above '<style>' on line 1.",
210212
line: 1,
211-
column: 37
213+
column: 37,
214+
endLine: 1,
215+
endColumn: 54
212216
}
213217
]
214218
},
@@ -220,7 +224,9 @@ tester.run('block-order', rule, {
220224
{
221225
message: "'<script>' should be above '<template>' on line 1.",
222226
line: 1,
223-
column: 22
227+
column: 22,
228+
endLine: 1,
229+
endColumn: 39
224230
}
225231
]
226232
},
@@ -241,7 +247,10 @@ tester.run('block-order', rule, {
241247
errors: [
242248
{
243249
message: "'<script>' should be above '<style>' on line 4.",
244-
line: 6
250+
line: 6,
251+
column: 9,
252+
endLine: 6,
253+
endColumn: 26
245254
}
246255
]
247256
},
@@ -261,7 +270,10 @@ tester.run('block-order', rule, {
261270
errors: [
262271
{
263272
message: "'<script>' should be above '<template>' on line 2.",
264-
line: 3
273+
line: 3,
274+
column: 9,
275+
endLine: 3,
276+
endColumn: 26
265277
}
266278
]
267279
},
@@ -281,7 +293,10 @@ tester.run('block-order', rule, {
281293
errors: [
282294
{
283295
message: "'<template>' should be above '<script>' on line 2.",
284-
line: 3
296+
line: 3,
297+
column: 9,
298+
endLine: 3,
299+
endColumn: 30
285300
}
286301
]
287302
},
@@ -303,7 +318,10 @@ tester.run('block-order', rule, {
303318
errors: [
304319
{
305320
message: "'<docs>' should be above '<template>' on line 2.",
306-
line: 3
321+
line: 3,
322+
column: 9,
323+
endLine: 3,
324+
endColumn: 22
307325
}
308326
]
309327
},
@@ -325,7 +343,10 @@ tester.run('block-order', rule, {
325343
errors: [
326344
{
327345
message: "'<script>' should be above '<template>' on line 2.",
328-
line: 4
346+
line: 4,
347+
column: 9,
348+
endLine: 4,
349+
endColumn: 26
329350
}
330351
]
331352
},
@@ -349,7 +370,10 @@ tester.run('block-order', rule, {
349370
errors: [
350371
{
351372
message: "'<script>' should be above '<template>' on line 2.",
352-
line: 5
373+
line: 5,
374+
column: 9,
375+
endLine: 5,
376+
endColumn: 26
353377
}
354378
]
355379
},
@@ -364,7 +388,10 @@ tester.run('block-order', rule, {
364388
errors: [
365389
{
366390
message: "'<template>' should be above '<script>' on line 2.",
367-
line: 3
391+
line: 3,
392+
column: 9,
393+
endLine: 3,
394+
endColumn: 30
368395
}
369396
]
370397
},
@@ -383,11 +410,17 @@ tester.run('block-order', rule, {
383410
errors: [
384411
{
385412
message: "'<template>' should be above '<style>' on line 2.",
386-
line: 3
413+
line: 3,
414+
column: 9,
415+
endLine: 3,
416+
endColumn: 30
387417
},
388418
{
389419
message: "'<script>' should be above '<style>' on line 2.",
390-
line: 4
420+
line: 4,
421+
column: 9,
422+
endLine: 4,
423+
endColumn: 26
391424
}
392425
]
393426
},
@@ -408,11 +441,17 @@ tester.run('block-order', rule, {
408441
errors: [
409442
{
410443
message: "'<template>' should be above '<style>' on line 2.",
411-
line: 4
444+
line: 4,
445+
column: 9,
446+
endLine: 4,
447+
endColumn: 30
412448
},
413449
{
414450
message: "'<script>' should be above '<style>' on line 2.",
415-
line: 5
451+
line: 5,
452+
column: 9,
453+
endLine: 5,
454+
endColumn: 26
416455
}
417456
]
418457
},
@@ -426,7 +465,10 @@ tester.run('block-order', rule, {
426465
errors: [
427466
{
428467
message: "'<script>' should be above '<style>' on line 2.",
429-
line: 3
468+
line: 3,
469+
column: 9,
470+
endLine: 3,
471+
endColumn: 26
430472
}
431473
]
432474
},
@@ -438,7 +480,10 @@ tester.run('block-order', rule, {
438480
{
439481
message:
440482
"'<i18n locale=en>' should be above '<i18n locale=ja>' on line 1.",
441-
line: 1
483+
line: 1,
484+
column: 26,
485+
endLine: 1,
486+
endColumn: 51
442487
}
443488
]
444489
},
@@ -449,7 +494,10 @@ tester.run('block-order', rule, {
449494
errors: [
450495
{
451496
message: "'<style>' should be above '<style scoped>' on line 1.",
452-
line: 1
497+
line: 1,
498+
column: 23,
499+
endLine: 1,
500+
endColumn: 38
453501
}
454502
]
455503
},
@@ -460,7 +508,10 @@ tester.run('block-order', rule, {
460508
errors: [
461509
{
462510
message: "'<style scoped>' should be above '<style>' on line 1.",
463-
line: 1
511+
line: 1,
512+
column: 16,
513+
endLine: 1,
514+
endColumn: 38
464515
}
465516
]
466517
},
@@ -471,7 +522,10 @@ tester.run('block-order', rule, {
471522
errors: [
472523
{
473524
message: "'<script>' should be above '<style>' on line 1.",
474-
line: 1
525+
line: 1,
526+
column: 16,
527+
endLine: 1,
528+
endColumn: 33
475529
}
476530
]
477531
}

0 commit comments

Comments
 (0)