Skip to content
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

Add preferHanging configuration for expressions #173

Closed
dsherret opened this issue Jan 31, 2020 · 1 comment · Fixed by dprint/dprint#95
Closed

Add preferHanging configuration for expressions #173

dsherret opened this issue Jan 31, 2020 · 1 comment · Fixed by dprint/dprint#95

Comments

@dsherret
Copy link
Member

Right now by default, array literals will be hanging unless they are explicitly made multi-line. This should be changed to be multi-line by default and work similarly to the new preferHangingArguments. The code between these two areas should be shared as well because arrays are comma separated values.

@dsherret dsherret changed the title Array literals - Add preferHanging configuration Array literals, if statements, etc... - Add preferHanging configuration Feb 9, 2020
@dsherret dsherret pinned this issue Feb 9, 2020
@dsherret dsherret unpinned this issue Feb 9, 2020
@dsherret dsherret changed the title Array literals, if statements, etc... - Add preferHanging configuration Add preferHanging configuration for expressions Feb 10, 2020
dsherret referenced this issue in dprint/dprint Feb 10, 2020
Adds a `preferHanging` configuration setting that defaults to `false`.

Also fixes trailing comments not being inserted when going from single-line to multi-line.
@dsherret
Copy link
Member Author

dsherret commented Feb 10, 2020

This was a breaking change in the defaults. New behaviour shown here:

Playground

Before config the default was preferHanging: true, but now the default is preferHanging: false. Prettier is similar to preferHanging: false.

dsherret referenced this issue in dprint/dprint Jun 6, 2020
Adds a `preferHanging` configuration setting that defaults to `false`.

Also fixes trailing comments not being inserted when going from single-line to multi-line.
@dsherret dsherret transferred this issue from dprint/dprint Jul 11, 2021
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 a pull request may close this issue.

1 participant