Skip to content

Commit 5c0f465

Browse files
committed
fix lint
1 parent d270f50 commit 5c0f465

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

packages/svelte/src/compiler/errors.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -396,30 +396,30 @@ export function runes_mode_invalid_import(node, name) {
396396
}
397397

398398
/**
399-
* Cannot reassign or bind to snippet parameter
399+
* Cannot export snippet from a `<script module>` if it references logic or expressions inside the component
400400
* @param {null | number | NodeLike} node
401401
* @returns {never}
402402
*/
403-
export function snippet_parameter_assignment(node) {
404-
e(node, "snippet_parameter_assignment", "Cannot reassign or bind to snippet parameter");
403+
export function snippet_invalid_export(node) {
404+
e(node, "snippet_invalid_export", "Cannot export snippet from a `<script module>` if it references logic or expressions inside the component");
405405
}
406406

407407
/**
408-
* Cannot export state from a module if it is reassigned. Either export a function returning the state value or only mutate the state value's properties
408+
* Cannot reassign or bind to snippet parameter
409409
* @param {null | number | NodeLike} node
410410
* @returns {never}
411411
*/
412-
export function state_invalid_export(node) {
413-
e(node, "state_invalid_export", "Cannot export state from a module if it is reassigned. Either export a function returning the state value or only mutate the state value's properties");
412+
export function snippet_parameter_assignment(node) {
413+
e(node, "snippet_parameter_assignment", "Cannot reassign or bind to snippet parameter");
414414
}
415415

416416
/**
417-
* Cannot export snippet from a `<script module>` if it references logic or expressions inside the component
417+
* Cannot export state from a module if it is reassigned. Either export a function returning the state value or only mutate the state value's properties
418418
* @param {null | number | NodeLike} node
419419
* @returns {never}
420420
*/
421-
export function snippet_invalid_export(node) {
422-
e(node, "snippet_invalid_export", "Cannot export snippet from a `<script module>` if it references logic or expressions inside the component");
421+
export function state_invalid_export(node) {
422+
e(node, "state_invalid_export", "Cannot export state from a module if it is reassigned. Either export a function returning the state value or only mutate the state value's properties");
423423
}
424424

425425
/**

packages/svelte/src/compiler/phases/1-parse/state/tag.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,10 @@ function open(parser) {
315315
name
316316
},
317317
parameters: function_expression.params,
318-
body: create_fragment()
318+
body: create_fragment(),
319+
metadata: {
320+
can_hoist: false
321+
}
319322
});
320323
parser.stack.push(block);
321324
parser.fragments.push(block.body);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ export function SnippetBlock(node, context) {
3535
e.snippet_invalid_export(/** @type {any} */ (undefined_exports.get(name)));
3636
}
3737

38-
node.metadata = {
39-
can_hoist
40-
};
38+
node.metadata.can_hoist = can_hoist;
4139

4240
const { path } = context;
4341
const parent = path.at(-2);

0 commit comments

Comments
 (0)