Skip to content

Commit 4157db9

Browse files
authored
fix: correct typo in compiler error messages (#14044)
1 parent 224fcde commit 4157db9

File tree

13 files changed

+23
-18
lines changed

13 files changed

+23
-18
lines changed

.changeset/beige-stingrays-sip.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: replace typo in compiler error messages

documentation/docs/98-reference/.generated/compile-errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Can only bind to state or props
119119
### block_invalid_continuation_placement
120120

121121
```
122-
{:...} block is invalid at this position (did you forget to close the preceeding element or block?)
122+
{:...} block is invalid at this position (did you forget to close the preceding element or block?)
123123
```
124124

125125
### block_invalid_elseif

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
7575
## block_invalid_continuation_placement
7676

77-
> {:...} block is invalid at this position (did you forget to close the preceeding element or block?)
77+
> {:...} block is invalid at this position (did you forget to close the preceding element or block?)
7878
7979
## block_invalid_elseif
8080

packages/svelte/src/compiler/errors.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,12 +747,12 @@ export function block_duplicate_clause(node, name) {
747747
}
748748

749749
/**
750-
* {:...} block is invalid at this position (did you forget to close the preceeding element or block?)
750+
* {:...} block is invalid at this position (did you forget to close the preceding element or block?)
751751
* @param {null | number | NodeLike} node
752752
* @returns {never}
753753
*/
754754
export function block_invalid_continuation_placement(node) {
755-
e(node, "block_invalid_continuation_placement", "{:...} block is invalid at this position (did you forget to close the preceeding element or block?)");
755+
e(node, "block_invalid_continuation_placement", "{:...} block is invalid at this position (did you forget to close the preceding element or block?)");
756756
}
757757

758758
/**

packages/svelte/src/compiler/phases/3-transform/css/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function render_stylesheet(source, analysis, options) {
4848
code.remove(0, ast.content.start);
4949
code.remove(/** @type {number} */ (ast.content.end), source.length);
5050
if (state.minify) {
51-
remove_preceeding_whitespace(ast.content.end, state);
51+
remove_preceding_whitespace(ast.content.end, state);
5252
}
5353

5454
const css = {
@@ -122,7 +122,7 @@ const visitors = {
122122
index++;
123123
}
124124
} else if (state.minify) {
125-
remove_preceeding_whitespace(node.start, state);
125+
remove_preceding_whitespace(node.start, state);
126126

127127
// Don't minify whitespace in custom properties, since some browsers (Chromium < 99)
128128
// treat --foo: ; and --foo:; differently
@@ -136,8 +136,8 @@ const visitors = {
136136
},
137137
Rule(node, { state, next, visit }) {
138138
if (state.minify) {
139-
remove_preceeding_whitespace(node.start, state);
140-
remove_preceeding_whitespace(node.block.end - 1, state);
139+
remove_preceding_whitespace(node.start, state);
140+
remove_preceding_whitespace(node.block.end - 1, state);
141141
}
142142

143143
// keep empty rules in dev, because it's convenient to
@@ -385,7 +385,7 @@ const visitors = {
385385
* @param {number} end
386386
* @param {State} state
387387
*/
388-
function remove_preceeding_whitespace(end, state) {
388+
function remove_preceding_whitespace(end, state) {
389389
let start = end;
390390
while (/\s/.test(state.code.original[start - 1])) start--;
391391
if (start < end) state.code.remove(start, end);

packages/svelte/tests/compiler-errors/samples/catch-without-await/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default test({
44
error: {
55
code: 'block_invalid_continuation_placement',
66
message:
7-
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
7+
'{:...} block is invalid at this position (did you forget to close the preceding element or block?)',
88
position: [1, 1]
99
}
1010
});

packages/svelte/tests/compiler-errors/samples/else-before-closing-3/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default test({
44
error: {
55
code: 'block_invalid_continuation_placement',
66
message:
7-
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
7+
'{:...} block is invalid at this position (did you forget to close the preceding element or block?)',
88
position: [6, 6]
99
}
1010
});

packages/svelte/tests/compiler-errors/samples/else-before-closing/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default test({
44
error: {
55
code: 'block_invalid_continuation_placement',
66
message:
7-
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
7+
'{:...} block is invalid at this position (did you forget to close the preceding element or block?)',
88
position: [18, 18]
99
}
1010
});

packages/svelte/tests/compiler-errors/samples/else-if-before-closing-2/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default test({
44
error: {
55
code: 'block_invalid_continuation_placement',
66
message:
7-
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
7+
'{:...} block is invalid at this position (did you forget to close the preceding element or block?)',
88
position: [17, 17]
99
}
1010
});

packages/svelte/tests/compiler-errors/samples/then-before-closing/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default test({
44
error: {
55
code: 'block_invalid_continuation_placement',
66
message:
7-
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
7+
'{:...} block is invalid at this position (did you forget to close the preceding element or block?)',
88
position: [21, 21]
99
}
1010
});

packages/svelte/tests/compiler-errors/samples/then-without-await/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default test({
44
error: {
55
code: 'block_invalid_continuation_placement',
66
message:
7-
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
7+
'{:...} block is invalid at this position (did you forget to close the preceding element or block?)',
88
position: [1, 1]
99
}
1010
});

packages/svelte/tests/migrate/samples/derivations/input.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// no semicolon at the end
77
$: time_8 = count * 8
88
$: ({ time_16 } = { time_16: count * 16 })
9-
// preceeding let that doesn't do anything
9+
// preceding let that doesn't do anything
1010
let time_32;
1111
$: time_32 = count * doubled;
1212
let very_high;

packages/svelte/tests/migrate/samples/derivations/output.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
// no semicolon at the end
77
let time_8 = $derived(count * 8)
88
let { time_16 } = $derived({ time_16: count * 16 })
9-
// preceeding let that doesn't do anything
9+
// preceding let that doesn't do anything
1010
let time_32 = $derived(count * doubled);
1111
1212
let very_high = $derived(time_32 * count);
1313
1414
</script>
1515

16-
{count} / {doubled} / {quadrupled} / {time_8} / {time_16}
16+
{count} / {doubled} / {quadrupled} / {time_8} / {time_16}

0 commit comments

Comments
 (0)