Skip to content

Commit 38e6147

Browse files
committed
tweak error messages
1 parent 8ba8511 commit 38e6147

File tree

23 files changed

+48
-48
lines changed

23 files changed

+48
-48
lines changed

packages/svelte/messages/compile-errors/style.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,35 @@
88
99
## css_global_block_invalid_combinator
1010

11-
> A :global {...} block cannot follow a %name% combinator
11+
> A `:global` selector cannot follow a `%name%` combinator
1212
1313
## css_global_block_invalid_declaration
1414

15-
> A :global {...} block can only contain rules, not declarations
15+
> A `:global {...}` block can only contain rules, not declarations
1616
1717
## css_global_block_invalid_list
1818

19-
> A :global {...} block cannot be part of a selector list with more than one item
19+
> A `:global` selector cannot be part of a selector list with more than one item
2020
2121
## css_global_block_invalid_modifier
2222

23-
> A :global {...} block cannot modify an existing selector
23+
> A `:global` selector cannot modify an existing selector
2424
2525
## css_global_block_invalid_modifier_start
2626

27-
> A :global {...} block at the very beginning cannot be modified by other selectors
27+
> A `:global` selector at the very beginning cannot be modified by other selectors
2828
2929
## css_global_invalid_placement
3030

31-
> :global(...) can be at the start or end of a selector sequence, but not in the middle
31+
> `:global(...)` can be at the start or end of a selector sequence, but not in the middle
3232
3333
## css_global_invalid_selector
3434

35-
> :global(...) must contain exactly one selector
35+
> `:global(...)` must contain exactly one selector
3636
3737
## css_global_invalid_selector_list
3838

39-
> :global(...) must not contain type or universal selectors when used in a compound selector
39+
> `:global(...)` must not contain type or universal selectors when used in a compound selector
4040
4141
## css_nesting_selector_invalid_placement
4242

@@ -48,4 +48,4 @@
4848
4949
## css_type_selector_invalid_placement
5050

51-
> :global(...) must not be followed with a type selector
51+
> `:global(...)` must not be followed with a type selector

packages/svelte/src/compiler/errors.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -434,76 +434,76 @@ export function css_expected_identifier(node) {
434434
}
435435

436436
/**
437-
* A :global {...} block cannot follow a %name% combinator
437+
* A `:global` selector cannot follow a `%name%` combinator
438438
* @param {null | number | NodeLike} node
439439
* @param {string} name
440440
* @returns {never}
441441
*/
442442
export function css_global_block_invalid_combinator(node, name) {
443-
e(node, "css_global_block_invalid_combinator", `A :global {...} block cannot follow a ${name} combinator`);
443+
e(node, "css_global_block_invalid_combinator", `A \`:global\` selector cannot follow a \`${name}\` combinator`);
444444
}
445445

446446
/**
447-
* A :global {...} block can only contain rules, not declarations
447+
* A `:global {...}` block can only contain rules, not declarations
448448
* @param {null | number | NodeLike} node
449449
* @returns {never}
450450
*/
451451
export function css_global_block_invalid_declaration(node) {
452-
e(node, "css_global_block_invalid_declaration", "A :global {...} block can only contain rules, not declarations");
452+
e(node, "css_global_block_invalid_declaration", "A `:global {...}` block can only contain rules, not declarations");
453453
}
454454

455455
/**
456-
* A :global {...} block cannot be part of a selector list with more than one item
456+
* A `:global` selector cannot be part of a selector list with more than one item
457457
* @param {null | number | NodeLike} node
458458
* @returns {never}
459459
*/
460460
export function css_global_block_invalid_list(node) {
461-
e(node, "css_global_block_invalid_list", "A :global {...} block cannot be part of a selector list with more than one item");
461+
e(node, "css_global_block_invalid_list", "A `:global` selector cannot be part of a selector list with more than one item");
462462
}
463463

464464
/**
465-
* A :global {...} block cannot modify an existing selector
465+
* A `:global` selector cannot modify an existing selector
466466
* @param {null | number | NodeLike} node
467467
* @returns {never}
468468
*/
469469
export function css_global_block_invalid_modifier(node) {
470-
e(node, "css_global_block_invalid_modifier", "A :global {...} block cannot modify an existing selector");
470+
e(node, "css_global_block_invalid_modifier", "A `:global` selector cannot modify an existing selector");
471471
}
472472

473473
/**
474-
* A :global {...} block at the very beginning cannot be modified by other selectors
474+
* A `:global` selector at the very beginning cannot be modified by other selectors
475475
* @param {null | number | NodeLike} node
476476
* @returns {never}
477477
*/
478478
export function css_global_block_invalid_modifier_start(node) {
479-
e(node, "css_global_block_invalid_modifier_start", "A :global {...} block at the very beginning cannot be modified by other selectors");
479+
e(node, "css_global_block_invalid_modifier_start", "A `:global` selector at the very beginning cannot be modified by other selectors");
480480
}
481481

482482
/**
483-
* :global(...) can be at the start or end of a selector sequence, but not in the middle
483+
* `:global(...)` can be at the start or end of a selector sequence, but not in the middle
484484
* @param {null | number | NodeLike} node
485485
* @returns {never}
486486
*/
487487
export function css_global_invalid_placement(node) {
488-
e(node, "css_global_invalid_placement", ":global(...) can be at the start or end of a selector sequence, but not in the middle");
488+
e(node, "css_global_invalid_placement", "`:global(...)` can be at the start or end of a selector sequence, but not in the middle");
489489
}
490490

491491
/**
492-
* :global(...) must contain exactly one selector
492+
* `:global(...)` must contain exactly one selector
493493
* @param {null | number | NodeLike} node
494494
* @returns {never}
495495
*/
496496
export function css_global_invalid_selector(node) {
497-
e(node, "css_global_invalid_selector", ":global(...) must contain exactly one selector");
497+
e(node, "css_global_invalid_selector", "`:global(...)` must contain exactly one selector");
498498
}
499499

500500
/**
501-
* :global(...) must not contain type or universal selectors when used in a compound selector
501+
* `:global(...)` must not contain type or universal selectors when used in a compound selector
502502
* @param {null | number | NodeLike} node
503503
* @returns {never}
504504
*/
505505
export function css_global_invalid_selector_list(node) {
506-
e(node, "css_global_invalid_selector_list", ":global(...) must not contain type or universal selectors when used in a compound selector");
506+
e(node, "css_global_invalid_selector_list", "`:global(...)` must not contain type or universal selectors when used in a compound selector");
507507
}
508508

509509
/**
@@ -525,12 +525,12 @@ export function css_selector_invalid(node) {
525525
}
526526

527527
/**
528-
* :global(...) must not be followed with a type selector
528+
* `:global(...)` must not be followed with a type selector
529529
* @param {null | number | NodeLike} node
530530
* @returns {never}
531531
*/
532532
export function css_type_selector_invalid_placement(node) {
533-
e(node, "css_type_selector_invalid_placement", ":global(...) must not be followed with a type selector");
533+
e(node, "css_type_selector_invalid_placement", "`:global(...)` must not be followed with a type selector");
534534
}
535535

536536
/**

packages/svelte/tests/compiler-errors/samples/css-global-block-combinator-2/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { test } from '../../test';
33
export default test({
44
error: {
55
code: 'css_global_block_invalid_combinator',
6-
message: 'A :global {...} block cannot follow a > combinator',
6+
message: 'A `:global` selector cannot follow a `>` combinator',
77
position: [79, 88]
88
}
99
});

packages/svelte/tests/compiler-errors/samples/css-global-block-combinator/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { test } from '../../test';
33
export default test({
44
error: {
55
code: 'css_global_block_invalid_combinator',
6-
message: 'A :global {...} block cannot follow a > combinator',
6+
message: 'A `:global` selector cannot follow a `>` combinator',
77
position: [54, 63]
88
}
99
});

packages/svelte/tests/compiler-errors/samples/css-global-block-declaration/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { test } from '../../test';
33
export default test({
44
error: {
55
code: 'css_global_block_invalid_declaration',
6-
message: 'A :global {...} block can only contain rules, not declarations',
6+
message: 'A `:global {...}` block can only contain rules, not declarations',
77
position: [109, 119]
88
}
99
});

packages/svelte/tests/compiler-errors/samples/css-global-block-multiple/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { test } from '../../test';
33
export default test({
44
error: {
55
code: 'css_global_block_invalid_list',
6-
message: 'A :global {...} block cannot be part of a selector list with more than one item',
6+
message: 'A `:global` selector cannot be part of a selector list with more than one item',
77
position: [9, 31]
88
}
99
});

packages/svelte/tests/compiler-errors/samples/css-global-modifier-start-1/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { test } from '../../test';
33
export default test({
44
error: {
55
code: 'css_global_block_invalid_modifier_start',
6-
message: 'A :global {...} block at the very beginning cannot be modified by other selectors',
6+
message: 'A `:global` selector at the very beginning cannot be modified by other selectors',
77
position: [75, 77]
88
}
99
});

packages/svelte/tests/compiler-errors/samples/css-global-modifier-start-2/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { test } from '../../test';
33
export default test({
44
error: {
55
code: 'css_global_block_invalid_modifier_start',
6-
message: 'A :global {...} block at the very beginning cannot be modified by other selectors',
6+
message: 'A `:global` selector at the very beginning cannot be modified by other selectors',
77
position: [147, 148]
88
}
99
});

packages/svelte/tests/compiler-errors/samples/css-global-modifier/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { test } from '../../test';
33
export default test({
44
error: {
55
code: 'css_global_block_invalid_modifier',
6-
message: 'A :global {...} block cannot modify an existing selector',
6+
message: 'A `:global` selector cannot modify an existing selector',
77
position: [70, 77]
88
}
99
});

packages/svelte/tests/validator/samples/css-invalid-global-placement-2/errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"code": "css_global_invalid_placement",
4-
"message": ":global(...) can be at the start or end of a selector sequence, but not in the middle",
4+
"message": "`:global(...)` can be at the start or end of a selector sequence, but not in the middle",
55
"start": {
66
"line": 8,
77
"column": 6

packages/svelte/tests/validator/samples/css-invalid-global-placement-3/errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"code": "css_global_invalid_placement",
4-
"message": ":global(...) can be at the start or end of a selector sequence, but not in the middle",
4+
"message": "`:global(...)` can be at the start or end of a selector sequence, but not in the middle",
55
"start": {
66
"line": 5,
77
"column": 6

packages/svelte/tests/validator/samples/css-invalid-global-placement-4/errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"code": "css_global_invalid_selector_list",
4-
"message": ":global(...) must not contain type or universal selectors when used in a compound selector",
4+
"message": "`:global(...)` must not contain type or universal selectors when used in a compound selector",
55
"start": {
66
"line": 2,
77
"column": 5

packages/svelte/tests/validator/samples/css-invalid-global-placement-5/errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"code": "css_global_invalid_selector_list",
4-
"message": ":global(...) must not contain type or universal selectors when used in a compound selector",
4+
"message": "`:global(...)` must not contain type or universal selectors when used in a compound selector",
55
"start": {
66
"line": 2,
77
"column": 5

packages/svelte/tests/validator/samples/css-invalid-global-placement-6/errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"code": "css_global_invalid_selector_list",
4-
"message": ":global(...) must not contain type or universal selectors when used in a compound selector",
4+
"message": "`:global(...)` must not contain type or universal selectors when used in a compound selector",
55
"start": {
66
"line": 5,
77
"column": 5

packages/svelte/tests/validator/samples/css-invalid-global-placement/errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"code": "css_global_invalid_placement",
4-
"message": ":global(...) can be at the start or end of a selector sequence, but not in the middle",
4+
"message": "`:global(...)` can be at the start or end of a selector sequence, but not in the middle",
55
"start": {
66
"line": 2,
77
"column": 6

packages/svelte/tests/validator/samples/css-invalid-global-selector-2/errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"code": "css_global_invalid_selector",
4-
"message": ":global(...) must contain exactly one selector",
4+
"message": "`:global(...)` must contain exactly one selector",
55
"start": {
66
"line": 11,
77
"column": 5

packages/svelte/tests/validator/samples/css-invalid-global-selector-3/errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"code": "css_global_invalid_selector",
4-
"message": ":global(...) must contain exactly one selector",
4+
"message": "`:global(...)` must contain exactly one selector",
55
"start": {
66
"line": 5,
77
"column": 5

packages/svelte/tests/validator/samples/css-invalid-global-selector-4/errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"code": "css_global_invalid_selector",
4-
"message": ":global(...) must contain exactly one selector",
4+
"message": "`:global(...)` must contain exactly one selector",
55
"start": {
66
"line": 2,
77
"column": 5

packages/svelte/tests/validator/samples/css-invalid-global-selector-5/errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"code": "css_global_invalid_selector",
4-
"message": ":global(...) must contain exactly one selector",
4+
"message": "`:global(...)` must contain exactly one selector",
55
"start": {
66
"line": 5,
77
"column": 1

packages/svelte/tests/validator/samples/css-invalid-global-selector-6/errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"code": "css_global_invalid_selector",
4-
"message": ":global(...) must contain exactly one selector",
4+
"message": "`:global(...)` must contain exactly one selector",
55
"start": {
66
"line": 5,
77
"column": 1

packages/svelte/tests/validator/samples/css-invalid-global-selector-list/errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"code": "css_global_invalid_selector_list",
4-
"message": ":global(...) must not contain type or universal selectors when used in a compound selector",
4+
"message": "`:global(...)` must not contain type or universal selectors when used in a compound selector",
55
"start": {
66
"line": 20,
77
"column": 6

packages/svelte/tests/validator/samples/css-invalid-global-selector/errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"code": "css_global_invalid_selector",
4-
"message": ":global(...) must contain exactly one selector",
4+
"message": "`:global(...)` must contain exactly one selector",
55
"start": {
66
"line": 11,
77
"column": 5

packages/svelte/tests/validator/samples/css-invalid-type-selector-placement/errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"code": "css_type_selector_invalid_placement",
4-
"message": ":global(...) must not be followed with a type selector",
4+
"message": "`:global(...)` must not be followed with a type selector",
55
"start": {
66
"line": 17,
77
"column": 14

0 commit comments

Comments
 (0)