-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] Break down big prop objects into separate lines #170
Comments
Fixing this is easy. The only question is, do we want to change this behavior for everything? I think the only question is whether we want to have that for svelte control blocks, too. It may then look like this: <p>
asdddddddddddddddddddddddddddddddddddddddd{#await Promise.resolve(
"asd"
) then b}s{/await}
</p> @Conduitry @ehrencrona what do you think? |
Fixes sveltejs#170 ### BREAKING CHANGE When a line exceeds the maximum characters, it is now possible to break the js expressions, too
I’d say it’s reasonable to do it in control blocks, too, but I’m not sure I can overview all the consequences. |
After some more thought I think it's better to not break up control blocks. In the case of if/else they might contain destructurings/arrays which would look really clunky broken up. So I'd say break everything except control blocks. |
Fixes #170 ### BREAKING CHANGE If the js content inside a mustache tag is too long, break it up if possible. Only exception are Svelte Blocks (#if/#await/etc) because that looks stupid.
Is your feature request related to a problem? Please describe.
Currently prettier plugin does not break down big props/objects into multiple lines if it is placed in template. More than that, it puts everything into one huge line, ignoring the
printWidth
setting.Describe the solution you'd like
It should work exactly like it does in other places.
Take this code as an example:
It should be formatted into something like this:
The text was updated successfully, but these errors were encountered: