Skip to content

Commit ab851d5

Browse files
fix: It looks like a bunch of unformatted shit came in through main?? idk
1 parent 4c84313 commit ab851d5

File tree

24 files changed

+94
-97
lines changed

24 files changed

+94
-97
lines changed

packages/svelte/src/compiler/errors.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ const attributes = {
234234
type === 'no-each'
235235
? `An element that uses the animate directive must be the immediate child of a keyed each block`
236236
: type === 'each-key'
237-
? `An element that uses the animate directive must be used inside a keyed each block. Did you forget to add a key to your each block?`
238-
: `An element that uses the animate directive must be the sole child of a keyed each block`,
237+
? `An element that uses the animate directive must be used inside a keyed each block. Did you forget to add a key to your each block?`
238+
: `An element that uses the animate directive must be the sole child of a keyed each block`,
239239
'duplicate-animation': () => `An element can only have one 'animate' directive`,
240240
/** @param {string[] | undefined} [modifiers] */
241241
'invalid-event-modifier': (modifiers) =>
@@ -262,7 +262,7 @@ const attributes = {
262262
? `An element can only have one '${directive1}' directive`
263263
: `An element cannot have both ${describe(directive1)} directive and ${describe(
264264
directive2
265-
)} directive`;
265+
)} directive`;
266266
},
267267
'invalid-let-directive-placement': () => 'let directive at invalid position'
268268
};

packages/svelte/src/compiler/legacy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export function convert(source, ast) {
108108
// @ts-ignore
109109
delete node.parent;
110110
}
111-
})
111+
})
112112
: undefined
113113
};
114114
},

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ export default function tag(parser) {
108108
const type = meta_tags.has(name)
109109
? meta_tags.get(name)
110110
: regex_capital_letter.test(name[0]) || name === 'svelte:self' || name === 'svelte:component'
111-
? 'Component'
112-
: name === 'title' && parent_is_head(parser.stack)
113-
? 'TitleElement'
114-
: name === 'slot'
115-
? 'SlotElement'
116-
: 'RegularElement';
111+
? 'Component'
112+
: name === 'title' && parent_is_head(parser.stack)
113+
? 'TitleElement'
114+
: name === 'slot'
115+
? 'SlotElement'
116+
: 'RegularElement';
117117

118118
/** @type {import('#compiler').ElementLike} */
119119
// @ts-expect-error TODO can't figure out this error
@@ -131,7 +131,7 @@ export default function tag(parser) {
131131
has_spread: false
132132
},
133133
parent: null
134-
}
134+
}
135135
: {
136136
type: /** @type {import('#compiler').ElementLike['type']} */ (type),
137137
start,
@@ -140,7 +140,7 @@ export default function tag(parser) {
140140
attributes: [],
141141
fragment: create_fragment(true),
142142
parent: null
143-
};
143+
};
144144

145145
parser.allow_whitespace();
146146

packages/svelte/src/compiler/phases/1-parse/utils/mapped_code.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ export function combine_sourcemaps(filename, sourcemap_list) {
275275
sourcemap_list,
276276
() => null,
277277
true // skip optional field `sourcesContent`
278-
)
278+
)
279279
: remapping(
280280
// use loader interface
281281
sourcemap_list[0], // last map
@@ -291,7 +291,7 @@ export function combine_sourcemaps(filename, sourcemap_list) {
291291
}
292292
),
293293
true
294-
);
294+
);
295295

296296
if (!map.file) delete map.file; // skip optional field `file`
297297

packages/svelte/src/compiler/phases/2-analyze/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -710,12 +710,12 @@ const runes_scope_tweaker = {
710710
rune === '$state'
711711
? 'state'
712712
: rune === '$state.frozen'
713-
? 'frozen_state'
714-
: rune === '$derived'
715-
? 'derived'
716-
: path.is_rest
717-
? 'rest_prop'
718-
: 'prop';
713+
? 'frozen_state'
714+
: rune === '$derived'
715+
? 'derived'
716+
: path.is_rest
717+
? 'rest_prop'
718+
: 'prop';
719719
}
720720

721721
if (rune === '$props') {

packages/svelte/src/compiler/phases/3-transform/client/transform-client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export function client_component(source, analysis, options) {
201201
b.call('$.validate_store', store_reference, b.literal(name.slice(1))),
202202
store_get
203203
])
204-
)
204+
)
205205
: b.thunk(store_get)
206206
)
207207
);

packages/svelte/src/compiler/phases/3-transform/client/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ export function get_assignment_value(node, { state, visit }) {
2020
return operator === '='
2121
? /** @type {import('estree').Expression} */ (visit(node.right))
2222
: // turn something like x += 1 into x = x + 1
23-
b.binary(
23+
b.binary(
2424
/** @type {import('estree').BinaryOperator} */ (operator.slice(0, -1)),
2525
serialize_get_binding(node.left, state),
2626
/** @type {import('estree').Expression} */ (visit(node.right))
27-
);
27+
);
2828
} else if (
2929
node.left.type === 'MemberExpression' &&
3030
node.left.object.type === 'ThisExpression' &&
@@ -35,11 +35,11 @@ export function get_assignment_value(node, { state, visit }) {
3535
return operator === '='
3636
? /** @type {import('estree').Expression} */ (visit(node.right))
3737
: // turn something like x += 1 into x = x + 1
38-
b.binary(
38+
b.binary(
3939
/** @type {import('estree').BinaryOperator} */ (operator.slice(0, -1)),
4040
/** @type {import('estree').Expression} */ (visit(node.left)),
4141
/** @type {import('estree').Expression} */ (visit(node.right))
42-
);
42+
);
4343
} else {
4444
return /** @type {import('estree').Expression} */ (visit(node.right));
4545
}

packages/svelte/src/compiler/phases/3-transform/client/visitors/javascript-runes.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,8 @@ export const javascript_visitors_runes = {
8787
field.kind === 'state'
8888
? b.call('$.source', should_proxy_or_freeze(init) ? b.call('$.proxy', init) : init)
8989
: field.kind === 'frozen_state'
90-
? b.call(
91-
'$.source',
92-
should_proxy_or_freeze(init) ? b.call('$.freeze', init) : init
93-
)
94-
: b.call('$.derived', b.thunk(init));
90+
? b.call('$.source', should_proxy_or_freeze(init) ? b.call('$.freeze', init) : init)
91+
: b.call('$.derived', b.thunk(init));
9592
} else {
9693
// if no arguments, we know it's state as `$derived()` is a compile error
9794
value = b.call('$.source');

packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -655,15 +655,15 @@ function serialize_element_special_value_attribute(element, node_id, attribute,
655655
// This ensures things stay in sync with the select binding
656656
// in case of updates to the option value or new values appearing
657657
b.call('$.selected', node_id)
658-
])
658+
])
659659
: needs_option_call
660-
? b.sequence([
661-
inner_assignment,
662-
// This ensures a one-way street to the DOM in case it's <select {value}>
663-
// and not <select bind:value>
664-
b.call('$.select_option', node_id, value)
665-
])
666-
: inner_assignment
660+
? b.sequence([
661+
inner_assignment,
662+
// This ensures a one-way street to the DOM in case it's <select {value}>
663+
// and not <select bind:value>
664+
b.call('$.select_option', node_id, value)
665+
])
666+
: inner_assignment
667667
);
668668

669669
if (is_reactive) {
@@ -953,7 +953,7 @@ function serialize_inline_component(node, component_name, context) {
953953
: b.call(
954954
'$.spread_props',
955955
...props_and_spreads.map((p) => (Array.isArray(p) ? b.object(p) : p))
956-
);
956+
);
957957
/** @param {import('estree').Identifier} node_id */
958958
let fn = (node_id) =>
959959
b.call(
@@ -2349,7 +2349,7 @@ export const template_visitors = {
23492349
? b.arrow(
23502350
[b.id('$$anchor')],
23512351
/** @type {import('estree').BlockStatement} */ (context.visit(node.fallback))
2352-
)
2352+
)
23532353
: b.literal(null);
23542354
const key_function =
23552355
node.key && ((each_type & EACH_ITEM_REACTIVE) !== 0 || context.state.options.dev)
@@ -2360,7 +2360,7 @@ export const template_visitors = {
23602360
b.return(/** @type {import('estree').Expression} */ (context.visit(node.key)))
23612361
)
23622362
)
2363-
)
2363+
)
23642364
: b.literal(null);
23652365

23662366
if (node.index && each_node_meta.contains_group_binding) {
@@ -2422,7 +2422,7 @@ export const template_visitors = {
24222422
? b.arrow(
24232423
[b.id('$$anchor')],
24242424
/** @type {import('estree').BlockStatement} */ (context.visit(node.alternate))
2425-
)
2425+
)
24262426
: b.literal(null)
24272427
)
24282428
)
@@ -2441,29 +2441,29 @@ export const template_visitors = {
24412441
? b.arrow(
24422442
[b.id('$$anchor')],
24432443
/** @type {import('estree').BlockStatement} */ (context.visit(node.pending))
2444-
)
2444+
)
24452445
: b.literal(null),
24462446
node.then
24472447
? b.arrow(
24482448
node.value
24492449
? [
24502450
b.id('$$anchor'),
24512451
/** @type {import('estree').Pattern} */ (context.visit(node.value))
2452-
]
2452+
]
24532453
: [b.id('$$anchor')],
24542454
/** @type {import('estree').BlockStatement} */ (context.visit(node.then))
2455-
)
2455+
)
24562456
: b.literal(null),
24572457
node.catch
24582458
? b.arrow(
24592459
node.error
24602460
? [
24612461
b.id('$$anchor'),
24622462
/** @type {import('estree').Pattern} */ (context.visit(node.error))
2463-
]
2463+
]
24642464
: [b.id('$$anchor')],
24652465
/** @type {import('estree').BlockStatement} */ (context.visit(node.catch))
2466-
)
2466+
)
24672467
: b.literal(null)
24682468
)
24692469
)
@@ -2885,9 +2885,9 @@ export const template_visitors = {
28852885
/** @type {import('estree').Expression} */ (node.expression).type ===
28862886
'ObjectExpression'
28872887
? // @ts-expect-error types don't match, but it can't contain spread elements and the structure is otherwise fine
2888-
b.object_pattern(node.expression.properties)
2888+
b.object_pattern(node.expression.properties)
28892889
: // @ts-expect-error types don't match, but it can't contain spread elements and the structure is otherwise fine
2890-
b.array_pattern(node.expression.elements),
2890+
b.array_pattern(node.expression.elements),
28912891
b.member(b.id('$$slotProps'), b.id(node.name))
28922892
),
28932893
b.return(b.object(bindings.map((binding) => b.init(binding.node.name, binding.node))))
@@ -2980,7 +2980,7 @@ export const template_visitors = {
29802980
: b.arrow(
29812981
[b.id('$$anchor')],
29822982
b.block(create_block(node, 'fallback', node.fragment.nodes, context))
2983-
);
2983+
);
29842984

29852985
const expression = is_default
29862986
? b.member(b.id('$$props'), b.id('children'))

packages/svelte/src/compiler/phases/3-transform/server/transform-server.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,11 @@ function get_assignment_value(node, { state, visit }) {
351351
return operator === '='
352352
? /** @type {import('estree').Expression} */ (visit(node.right))
353353
: // turn something like x += 1 into x = x + 1
354-
b.binary(
354+
b.binary(
355355
/** @type {import('estree').BinaryOperator} */ (operator.slice(0, -1)),
356356
serialize_get_binding(node.left, state),
357357
/** @type {import('estree').Expression} */ (visit(node.right))
358-
);
358+
);
359359
} else {
360360
return /** @type {import('estree').Expression} */ (visit(node.right));
361361
}
@@ -780,7 +780,7 @@ function serialize_element_spread_attributes(
780780
b.id('join')
781781
),
782782
b.literal(' ')
783-
)
783+
)
784784
: b.literal('');
785785
args.push(
786786
b.object([
@@ -933,7 +933,7 @@ function serialize_inline_component(node, component_name, context) {
933933
: b.call(
934934
'$.spread_props',
935935
b.array(props_and_spreads.map((p) => (Array.isArray(p) ? b.object(p) : p)))
936-
);
936+
);
937937

938938
/** @type {import('estree').Statement} */
939939
let statement = b.stmt(
@@ -942,7 +942,7 @@ function serialize_inline_component(node, component_name, context) {
942942
? b.call(
943943
'$.validate_component',
944944
typeof component_name === 'string' ? b.id(component_name) : component_name
945-
)
945+
)
946946
: component_name,
947947
b.id('$$payload'),
948948
props_expression
@@ -1034,7 +1034,7 @@ const javascript_visitors_legacy = {
10341034
'$.value_or_fallback',
10351035
prop,
10361036
/** @type {import('estree').Expression} */ (visit(declarator.init))
1037-
)
1037+
)
10381038
: prop;
10391039

10401040
declarations.push(b.declarator(declarator.id, init));
@@ -1172,7 +1172,7 @@ const template_visitors = {
11721172
template: [],
11731173
init: []
11741174
}
1175-
}
1175+
}
11761176
: { ...context, state };
11771177

11781178
const { hoisted, trimmed } = clean_nodes(
@@ -1496,9 +1496,9 @@ const template_visitors = {
14961496
b.let(
14971497
node.expression.type === 'ObjectExpression'
14981498
? // @ts-expect-error types don't match, but it can't contain spread elements and the structure is otherwise fine
1499-
b.object_pattern(node.expression.properties)
1499+
b.object_pattern(node.expression.properties)
15001500
: // @ts-expect-error types don't match, but it can't contain spread elements and the structure is otherwise fine
1501-
b.array_pattern(node.expression.elements),
1501+
b.array_pattern(node.expression.elements),
15021502
b.member(b.id('$$slotProps'), b.id(node.name))
15031503
),
15041504
b.return(b.object(bindings.map((binding) => b.init(binding.node.name, binding.node))))
@@ -1714,12 +1714,12 @@ function serialize_element_attributes(node, context) {
17141714
? b.call(
17151715
b.member(attribute.expression, b.id('includes')),
17161716
serialize_attribute_value(value_attribute.value, context)
1717-
)
1717+
)
17181718
: b.binary(
17191719
'===',
17201720
attribute.expression,
17211721
serialize_attribute_value(value_attribute.value, context)
1722-
),
1722+
),
17231723
metadata: {
17241724
contains_call_expression: false,
17251725
dynamic: false

packages/svelte/src/compiler/phases/3-transform/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export function infer_namespace(namespace, parent, nodes, path) {
198198
const parent_node =
199199
parent.type === 'Fragment'
200200
? // Messy: We know that Fragment calls create_block directly, so we can do this here
201-
path.at(-1)
201+
path.at(-1)
202202
: parent;
203203

204204
if (

packages/svelte/src/compiler/preprocess/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ async function process_markup(process, source) {
318318
string: processed.code,
319319
map: processed.map
320320
? // TODO: can we use decode_sourcemap?
321-
typeof processed.map === 'string'
321+
typeof processed.map === 'string'
322322
? JSON.parse(processed.map)
323323
: processed.map
324324
: undefined,

packages/svelte/src/compiler/utils/mapped_code.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ export function combine_sourcemaps(filename, sourcemap_list) {
258258
sourcemap_list,
259259
() => null,
260260
true // skip optional field `sourcesContent`
261-
)
261+
)
262262
: remapping(
263263
// use loader interface
264264
sourcemap_list[0], // last map
@@ -271,7 +271,7 @@ export function combine_sourcemaps(filename, sourcemap_list) {
271271
}
272272
},
273273
true
274-
);
274+
);
275275
if (!map.file) delete map.file; // skip optional field `file`
276276
// When source maps are combined and the leading map is empty, sources is not set.
277277
// Add the filename to the empty array in this case.

0 commit comments

Comments
 (0)