Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jycouet
Copy link
Contributor

@jycouet jycouet commented Dec 5, 2025

I'm not sure if it was on purpose or not.

With today's margin, vite config looks like https://github.com/sveltejs/cli/blob/main/packages/sv/lib/cli/tests/snapshots/create-with-all-addons/vite.config.ts

What do you think ?

@changeset-bot
Copy link

changeset-bot bot commented Dec 5, 2025

🦋 Changeset detected

Latest commit: 197c453

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
esrap Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 5, 2025

npm i https://pkg.pr.new/sveltejs/esrap@100

commit: 197c453

@manuel3108
Copy link
Member

I'm pretty sure this was added intentionally as this is the way code is formatted inside esrap and svelte codebases:

AssignmentExpression(node, context) {
context.visit(node.left);
context.write(` ${node.operator} `);
context.visit(node.right);
},
AssignmentPattern(node, context) {
context.visit(node.left);
context.write(' = ');
context.visit(node.right);
},

and

https://github.com/sveltejs/svelte/blob/965bf6ceec0c6ee5347df6b04781fe9fe41aa5a5/packages/svelte/src/compiler/print/index.js#L455-L465

I haven't checked many more places, but this does appear to be intentional. But I do agree that this looks weird in some places like you showed. Maybe we could avoid adding this extra line break if [i-1] and [i] are ObjectExpressions? That should solve the problem at hand and still work good for other use cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants