lukejacksonn / react-slack-clone

Complete chat application, built with Chatkit | by @lukejacksonn
https://pusher.com/chatkit
MIT License
1.35k stars 262 forks source link

Add Prettier and run against /src #72

Closed yazeedb closed 5 years ago

yazeedb commented 5 years ago

If there's any interest, integrating Prettier into this project was surprisingly easy.

Benefit (IMO):

  1. Enforcing a style guide in the project and future contributions. (See their page for a better explanation :grin:)
  2. Contributors using Prettier can now work with it instead of around it.

Implementation: I added a .prettierrc with the minimal config to mesh with the existing code style.

Also ran

node_modules/prettier/bin-prettier.js --write src/**/*.js

to "fix" everything in /src, only 3 files were affected.

lukejacksonn commented 5 years ago

Add the contents of .prettierrc to package.json under the key prettier and run npx prettier then I could merge this 👍

yazeedb commented 5 years ago

@lukejacksonn Done 👍

Do we need .prettierrc anymore?

lukejacksonn commented 5 years ago

Great! No we do not need .prettierrc anymore.. it being in the package.json is good enough. Also.. I don't usually add prettier as a dev dependency 🤔as I have it incorporated into my code editor, do you think this is the case for most people?

yazeedb commented 5 years ago

Good point. Only benefit I see is running Prettier from node_modules instead of requiring global installation. But that's only needed for fixing the codebase style, which this PR already does? 😜

I'll remove the devDep. We can always add it back if needed.

lukejacksonn commented 5 years ago

This looks good to me! Someone on the Chatkit team will have to merge it if they are happy 👍 cc @hamchapman @callum-oakley @vivangkumar

hamchapman commented 5 years ago

Awesome - thanks @yazeedb and @lukejacksonn 👍