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

Increase prettier line width to 100 #20535

Merged
merged 5 commits into from Jul 9, 2018

Conversation

Projects
None yet
7 participants
@timroes
Copy link
Contributor

commented Jul 6, 2018

In this PR I increase the max line width in prettier to 100. Since we enforce the prettier styling for TypeScript I wanted to put this up for discussion if 80 (which it was right now) is really reasonable. You can also check the auto fixes in this PR to get a feeling how 80 chars vs 100 chars will look like.

Please feel free to vote up/down on this PR to switch to 100 chars line width (and in case you also vote up, feel free to leave a review).

@markov00

This comment has been minimized.

Copy link
Member

commented Jul 6, 2018

Our style guide says 120 js_style_guide

@elasticmachine

This comment has been minimized.

Copy link

commented Jul 6, 2018

@elasticmachine

This comment has been minimized.

Copy link

commented Jul 6, 2018

@timroes

This comment has been minimized.

Copy link
Contributor Author

commented Jul 7, 2018

@markov00 I would understand Try to limit your lines to 80 characters. If it feels right, you can go up to 120 characters. As a flexible range between 80 and 120 🤔

Since people seem to like and upvote the 100 chars width, I would also change the styleguide accordingly, to be a bite more clear and not giving us a range.

Since we also enforce the line width in the reverse way, i.e. you cannot split up a line if it would fit into that setting, I would rather limit it to the 100 (that's somewhere in the middle of 80 and 120), since I think 120 char lines could tend to be rather long as a "must" have.

@elasticmachine

This comment has been minimized.

Copy link

commented Jul 7, 2018

@stacey-gammon

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2018

I'm neither here nor there on 80 vs 100, could go either way, but

I would also change the styleguide accordingly, to be a bit more clear and not giving us a range.

I'm +1 on picking a width and removing the ambiguity.

@ppisljar

This comment has been minimized.

Copy link
Member

commented Jul 9, 2018

i agree with @stacey-gammon i am also ok with updating only the docs

@timroes

This comment has been minimized.

Copy link
Contributor Author

commented Jul 9, 2018

@stacey-gammon @ppisljar I already updated the docs, to be less ambiguous about the length, and clearly set it to 100 with this PR.

@spalger

spalger approved these changes Jul 9, 2018

Copy link
Member

left a comment

LGTM

@cjcenizal
Copy link
Contributor

left a comment

I'm not happy with how prettier tries to cram as much code on a line as possible, but I'm glad we're picking an explicit line length!

@elasticmachine

This comment has been minimized.

Copy link

commented Jul 9, 2018

@timroes timroes merged commit cb5ee01 into elastic:master Jul 9, 2018

2 checks passed

CLA Commit author has signed the CLA
Details
kibana-ci Build finished.
Details

@timroes timroes deleted the timroes:ts-line-width branch Jul 9, 2018

timroes added a commit to timroes/kibana that referenced this pull request Jul 9, 2018

Increase prettier line width to 100 (elastic#20535)
* Increase prettier line width to 100

* Fix packages JS prettier

* Change style guide to 100 width

* Fix line-width in latest master changes

timroes added a commit that referenced this pull request Jul 10, 2018

Increase prettier line width to 100 (#20535) (#20596)
* Increase prettier line width to 100

* Fix packages JS prettier

* Change style guide to 100 width

* Fix line-width in latest master changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.