From da5885e04669ecbec3e0fb312cd8311abafc5cd7 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 28 May 2025 18:19:35 -0400 Subject: [PATCH] lint --- .../server/visitors/RegularElement.js | 68 +++++++++---------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/packages/svelte/src/compiler/phases/3-transform/server/visitors/RegularElement.js b/packages/svelte/src/compiler/phases/3-transform/server/visitors/RegularElement.js index c19e995349..65959938ac 100644 --- a/packages/svelte/src/compiler/phases/3-transform/server/visitors/RegularElement.js +++ b/packages/svelte/src/compiler/phases/3-transform/server/visitors/RegularElement.js @@ -1,3 +1,4 @@ +/** @import { Expression } from 'estree' */ /** @import { Location } from 'locate-character' */ /** @import { AST } from '#compiler' */ /** @import { ComponentContext, ComponentServerTransformState } from '../types.js' */ @@ -127,55 +128,50 @@ export function RegularElement(node, context) { } } - const is_option_with_implicit_value = + if ( node.name === 'option' && !node.attributes.some( (attribute) => attribute.type === 'SpreadAttribute' || ((attribute.type === 'Attribute' || attribute.type === 'BindDirective') && attribute.name === 'value') - ); - - if (body === null && !is_option_with_implicit_value) { - process_children(trimmed, { ...context, state }); - } else { - // we need the body if: - - // - it's a