lbry-desktop icon indicating copy to clipboard operation
lbry-desktop copied to clipboard

Use Prettier

Open neb-b opened this issue 9 years ago • 6 comments

The Issue

Currently the js code has all sorts of different styles. (single/double quotes, semi/no-semi, tabs/spaces)

I think it would be beneficial to add Prettier to have a more unified code base. I also created a PR implementing it here: https://github.com/lbryio/lbry-app/pull/201

I am creating this issue to see what everyone thinks

neb-b avatar Jun 06 '17 04:06 neb-b

I would love to see prettier integrated :+1:

6ea86b96 avatar Jun 06 '17 04:06 6ea86b96

I prefer tabs, but I know others prefer to use spaces. Maybe we could do a thumbs up/thumbs down on this comment to determine the majority opinion?

Thumbs up: tabs Thumbs down: spaces

neb-b avatar Jun 06 '17 05:06 neb-b

This is a good idea. Need to look into it a bit more, but expect a merge later today.

kauffj avatar Jun 06 '17 13:06 kauffj

I think this is a great idea and it will be needed now as more and more people contribute code!

filipnyquist avatar Jun 06 '17 13:06 filipnyquist

This is merged. I decided to keep spaces over tabs since I think it's more common, but I don't feel strongly about this. I also added trailing commas where supported by ES5 (objects, arrays), switched from single quotes to double quotes, since JSX will be all double quotes anyway, and fixed the monitor path to compile on push.

@alexliebowitz @6ea86b96 @lyoshenka @jackrobison please:

  1. Rebase any active branches to be on top of master to minimize later merge headaches.
  2. Make sure that auto-formatting is working for you on your next commit.

kauffj avatar Jun 06 '17 21:06 kauffj

Are we really going with 80 chars per line max? Can we do something more reasonable, like maybe 120?

Im switching to 120 unless anyone objects.

lyoshenka avatar Jun 07 '17 16:06 lyoshenka