universelabs / universe

Decentralized private key recovery
https://universe.engineering
MIT License
13 stars 2 forks source link

Research and install Prettier #60

Closed guylepage3 closed 5 years ago

guylepage3 commented 5 years ago

Description Research and install Prettier.io for better styling of code without having to discuss what style is better and saves a lot of time.

Create React App folks recommend using Prettier. Setting Up Your Editor

Initial install on a front-end

For initial install on a React front-end and to set up automatic code formatting execute the following. Skip this if someone else has set it up already.

Step 1

Add prettier to your project: npm install prettier --save-dev --save-exact

Step 2

Verify by running against a file: npx prettier --write src/index.js

Step 3

Run prettier when commiting files: npm install pretty-quick husky --save-dev Then add this config to package.json: { "husky": { "hooks": { "pre-commit": "pretty-quick --staged" } } }

Setting up Prettier on Sublime Text 3

Setting up Prettier on VSCode

Not sure how to do this on VSCode but I would imagine it's quite simple. Here's a video tutorial I found for those using VSCode. VSCode ESLint, Prettier & Airbnb Style Guide Setup

guylepage3 commented 5 years ago

Done