Skip to content

Commit 1898483

Browse files
committed
lint
1 parent 409bebc commit 1898483

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ Cannot export state from a module if it is reassigned. Either export a function
751751
### state_invalid_opaque_declaration
752752

753753
```
754-
`%rune%(...)` must be declared with an array destructuring pattern (e.g. `let [state, invalidate] = $state.opaque(data);`)
754+
`$state.opaque(...)` must be declared with an destructured array pattern (e.g. `let [state, invalidate] = $state.opaque(data);`)
755755
```
756756

757757
### state_invalid_placement

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ It's possible to export a snippet from a `<script module>` block, but only if it
170170
171171
## state_invalid_opaque_declaration
172172

173-
> `%rune%(...)` must be declared with an array destructuring pattern (e.g. `let [state, invalidate] = $state.opaque(data);`)
173+
> `$state.opaque(...)` must be declared with an destructured array pattern (e.g. `let [state, invalidate] = $state.opaque(data);`)
174174
175175
## state_invalid_placement
176176

packages/svelte/src/compiler/errors.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,13 +433,12 @@ export function state_invalid_export(node) {
433433
}
434434

435435
/**
436-
* `%rune%(...)` must be declared with an array destructuring pattern (e.g. `let [state, invalidate] = $state.opaque(data);`)
436+
* `$state.opaque(...)` must be declared with an destructured array pattern (e.g. `let [state, invalidate] = $state.opaque(data);`)
437437
* @param {null | number | NodeLike} node
438-
* @param {string} rune
439438
* @returns {never}
440439
*/
441-
export function state_invalid_opaque_declaration(node, rune) {
442-
e(node, "state_invalid_opaque_declaration", `\`${rune}(...)\` must be declared with an array destructuring pattern (e.g. \`let [state, invalidate] = $state.opaque(data);\`)`);
440+
export function state_invalid_opaque_declaration(node) {
441+
e(node, "state_invalid_opaque_declaration", "`$state.opaque(...)` must be declared with an destructured array pattern (e.g. `let [state, invalidate] = $state.opaque(data);`)");
443442
}
444443

445444
/**

packages/svelte/src/compiler/phases/2-analyze/visitors/CallExpression.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function CallExpression(node, context) {
100100
parent.id.elements.length !== 2 ||
101101
parent.id.elements[0]?.type !== 'Identifier')
102102
) {
103-
e.state_invalid_opaque_declaration(node, rune);
103+
e.state_invalid_opaque_declaration(node);
104104
}
105105

106106
break;

0 commit comments

Comments
 (0)