small readability tweak

pull/15820/head
Rich Harris 4 months ago
parent 682b0e6970
commit 76b07e5b57

@ -114,17 +114,16 @@ export function CallExpression(node, context) {
case '$state': case '$state':
case '$state.raw': case '$state.raw':
case '$derived': case '$derived':
case '$derived.by': case '$derived.by': {
if ( const valid =
!(
is_variable_declaration(parent, context) || is_variable_declaration(parent, context) ||
is_class_property_definition(parent) || is_class_property_definition(parent) ||
context.state.class_state?.is_class_property_assignment_at_constructor_root( context.state.class_state?.is_class_property_assignment_at_constructor_root(
parent, parent,
context.path.slice(0, -1) context.path.slice(0, -1)
) );
)
) { if (!valid) {
e.state_invalid_placement(node, rune); e.state_invalid_placement(node, rune);
} }
@ -135,6 +134,7 @@ export function CallExpression(node, context) {
} }
break; break;
}
case '$effect': case '$effect':
case '$effect.pre': case '$effect.pre':

Loading…
Cancel
Save